question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CI Error: "Cannot find a definition for command named cypress/run"

See original GitHub issue

Hi, I’m having an odd issue when trying to use this orb. Here’s my config:

version: 2.1
orbs:
  cypress: 'cypress-io/cypress@1'
jobs:
  test:
    docker:
      - image: circleci/node:8-browsers
    steps:
      - checkout
      - run:
          name: Authenticate with npm registry
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
      # Cache to enable faster future jobs
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      # Run unit tests
      - run: npm run test
      # Run integration tests
      - cypress/run
workflows: 
  test_and_deploy:
    jobs: 
      - test

With this config the build fails immediately with the error “Cannot find a definition for command named cypress/run”. I thought there was some sort of issue with the orb installation, but I can replace cypress/run with cypress/install and that command runs just fine. Any ideas? This feels like something painfully obvious but I’m not sure where to look next.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Buuntucommented, Jun 15, 2020

yup, there is no “run” command in this Orb - there is “install”, but “run” is the name of the job.

Screen Shot 2019-06-17 at 4 04 15 PM

Looking at your config file, you just need npmrc token, which you can do simpler by following this example: https://github.com/cypress-io/circleci-orb/blob/master/docs/examples.md#install-private-npm-modules

I’m still getting this issue when trying to define a series of commands within a job. So should the above example look like this since there is no “cypress/run” command?

version: 2.1
orbs:
  cypress: 'cypress-io/cypress@1'
jobs:
  test:
    docker:
      - image: circleci/node:8-browsers
    steps:
      - checkout
      - run:
          name: Authenticate with npm registry
          command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
      # Cache to enable faster future jobs
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}
      # Run unit tests
      - run: npm run test
      # Run integration tests
      - run:
         command: "cypress" // change to this?
workflows: 
  test_and_deploy:
    jobs: 
      - test
1reaction
bahmutovcommented, Jun 17, 2019

yup, there is no “run” command in this Orb - there is “install”, but “run” is the name of the job.

Screen Shot 2019-06-17 at 4 04 15 PM

Looking at your config file, you just need npmrc token, which you can do simpler by following this example: https://github.com/cypress-io/circleci-orb/blob/master/docs/examples.md#install-private-npm-modules

Read more comments on GitHub >

github_iconTop Results From Across the Web

cypress-io/cypress - Gitter
I want to use - cypress/run as a step and I keep getting # Cannot find a definition for command named cypress/run. 7...
Read more >
Orbs - "Cannot find a definition for command named ..."
I'm getting the Cannot find a definition for command named ssh-deployment/deploy error. Does the second approach only work with “official” orbs?
Read more >
Running Cypress through CircleCi - Stack Overflow
The solution was simple. All I had to do was move the install-command from cypress/install to cypress/run . - cypress/install - cypress/run: ...
Read more >
Error Messages | Cypress Documentation
No tests found. This message means that Cypress was unable to find tests in the specified file. You'll likely get this message if...
Read more >
Continuous Integration - cypress - w3resource
'''npm start & cypress run // You should not do this''' ... run: name: Install Dependencies command: npm ci - save_cache: key: ```v1-deps-{{ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found