cypress: Failure to start Cypress on a fresh install nvm

Current behavior:

I installed cypress given the npm installation guide using the latest Node.js and npm versions (Node is running under nvm). I got the following error which is guiding me to install dependencies:

It looks like this is your first time using Cypress: 3.1.4

 ✖  Verifying Cypress can run /Users/benjamin/Library/Caches/Cypress/3.1.4/Cypress.app
   → Cypress Version: 3.1.4
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.
----------

/Users/benjamin/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/MacOS/Cypress: bad option: --smoke-test
/Users/benjamin/Library/Caches/Cypress/3.1.4/Cypress.app/Contents/MacOS/Cypress: bad option: --ping=22
----------

Platform: darwin (18.0.0)
Cypress Version: 3.1.4

Desired behavior:

Cypress should woprk.

Steps to reproduce: (app code and test code)

benjamin@Benjamins-MacBook-Pro Desktop $ create-react-app cypress-demo
benjamin@Benjamins-MacBook-Pro Desktop $ cd cypress-demo
benjamin@Benjamins-MacBook-Pro cypress-demo (master) $ npm i cypress
benjamin@Benjamins-MacBook-Pro cypress-demo (master) $ npx cypress open

Versions

Platform: darwin (18.0.0) Cypress Version: 3.1.4


I can try to investigate and contribute a patch if interested - though I was pretty surprised when such a simple setup failed 😕

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 40 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Unfortunately we have to close this issue as there is not enough information to reproduce the problem.

Please try unsetting the NODE_OPTIONS environment variable if you have this set - as this causes Cypress to crash. This is due to an Electron bug prior to version 2.0.3, where having NODE_OPTIONS set causes either a failure or arguments to be ignored. https://github.com/electron/electron/issues/12695#issuecomment-385826834

To see all environment variables currently set

MacOS / Linux

printenv

Windows

SET

To unset NODE_OPTIONS environment variable

MacOS / Linux

unset NODE_OPTIONS # this is not the same as export NODE_OPTIONS=

Windows

set NODE_OPTIONS=

We have open issues for this being fixed that you can follow here:

The problem reproduces pretty easily for me and I have offered to provide whatever additional information you might want for about 5 months now.

During those 5 months you have continuously said that there is not enough information (rather then tell me what the extra information you want is).

If we responded this way in Node.js to a bug report - there would be outrage.

I warmly recommend you consider a better approach to potential contributors.

That said - whatever works for you - good luck with the project.

You just changed stage: needs information to stage: awaiting response although I have provided all that information. To me this indicates I have not been communicating well.

I really don’t want to come off as aggressive or annoying.

I’m fine with any of “we’re looking into the issue”, “I’m not able to reproduce can you help me isolate” “I’d like to take you up on your offer to look into it” or “we don’t support running cypress with an nvm environment” 😃

How can I help move this forward?

People are still having this issue and I keep getting pings so I’m going to go ahead and unsubscribe. If you change your mind about fixing this or getting a repro you can find my email info at the node.js github repo home page.

Doing unset NODE_OPTIONS worked for me as well. Thank you @paqman and @jennifer-shehane !

We are running against a similar issue where cypress does not run when an environment variable is set. In our case it is NODE_OPTIONS.

runner@6bd0fb64c92f:~$ yarn cypress verify
yarn run v1.13.0
warning package.json: No license field
$ /home/runner/node_modules/.bin/cypress verify
It looks like this is your first time using Cypress: 3.1.5

✔  Verified Cypress! /home/runner/.cache/Cypress/3.1.5/Cypress
Done in 1.82s.

Running the same command with NODE_OPTIONS will break.

runner@6bd0fb64c92f:~$ DEBUG=cypress:* NODE_OPTIONS=--max_old_space_size=4096 yarn cypress verify
yarn run v1.13.0
warning package.json: No license field
$ /home/runner/node_modules/.bin/cypress verify
  cypress:cli cli starts with arguments ["/usr/bin/node","/home/runner/node_modules/.bin/cypress","verify"] +0ms
  cypress:cli NODE_OPTIONS=--max_old_space_size=4096 +0ms
  cypress:cli program parsing arguments +2ms
  cypress:cli parsed cli options {} +1ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +1ms
  cypress:cli checking if executable exists /home/runner/.cache/Cypress/3.1.5/Cypress/Cypress +2ms
  cypress:cli Binary is executable? : true +1ms
  cypress:cli binaryDir is  /home/runner/.cache/Cypress/3.1.5/Cypress +0ms
  cypress:cli Reading binary package.json from: /home/runner/.cache/Cypress/3.1.5/Cypress/resources/app/package.json +0ms
  cypress:cli Found binary version 3.1.5 installed in: /home/runner/.cache/Cypress/3.1.5/Cypress +2ms
  cypress:cli could not read binary_state.json file +3ms
  cypress:cli {} +0ms
  cypress:cli is Verified ? undefined +1ms
  cypress:cli force verify +0ms
  cypress:cli running binary verification check 3.1.5 +0ms
It looks like this is your first time using Cypress: 3.1.5

  cypress:cli clearing out the verified version +2ms
  cypress:cli running smoke test +1ms
  cypress:cli using Cypress executable /home/runner/.cache/Cypress/3.1.5/Cypress/Cypress +0ms
  cypress:cli needs XVFB? true +0ms
  cypress:cli Starting XVFB +0ms
  cypress:xvfb _XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root
  cypress:xvfb  +0ms
  cypress:cli smoke test command: /home/runner/.cache/Cypress/3.1.5/Cypress/Cypress --smoke-test --ping=3 +14ms
 ⠙  Verifying Cypress can run /home/runner/.cache/Cypress/3.1.5/Cypress
  cypress:cli Smoke test failed: { Error: Command failed: /home/runner/.cache/Cypress/3.1.5/Cypress/Cypress --smoke-test --ping=3


    at makeError (/home/runner/node_modules/execa/index.js:172:9)
    at Promise.all.then.arr (/home/runner/node_modules/execa/index.js:277:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: null,
  stdout: '',
  stderr: '',
  failed: true,
  signal: 'SIGSEGV',
  cmd:
   '/home/runner/.cache/Cypress/3.1.5/Cypress/Cypress --smoke-test --ping=3',
  timedOut: false,
  killed: false } +136ms
 ✖  Verifying Cypress can run /home/runner/.cache/Cypress/3.1.5/Cypress
   → Cypress Version: 3.1.5
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.
----------

Command failed: /home/runner/.cache/Cypress/3.1.5/Cypress/Cypress --smoke-test --ping=3
----------

Platform: linux (Ubuntu Linux - 16.04)
Cypress Version: 3.1.5
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@rdig Doesn’t make a difference whether DISPLAY is set to :1.5 or if I unset it before I run it.

EDIT: Looks like sudo makes a difference - and it works! Although I’m not sure why sudo would be necessary, and it would be handy if cypress actually showed which file it was failing to use in it’s non-elevated state.

@rdig I have seen unsetting the DISPLAY as a solution to other issues on install like here: https://github.com/cypress-io/cypress/issues/1556#issuecomment-418069209 but not everyone, need to narrow down what this issue is.