Bug
When I install cypress through npm, at the verification step the process fail with the message:
cypress:cli cli starts with arguments [".nodenv/versions/8.9.0/bin/node","node_modules/.bin/cypress","verify"] +0ms
cypress:cli program parsing arguments +2ms
cypress:cli verifying Cypress app +0ms
cypress:cli path to info.json file /node_modules/cypress/dist/info.json +0ms
cypress:cli { version: '2.1.0', verifiedVersion: null } +14ms
cypress:cli installed version is 2.1.0 comparing to 2.1.0 +16ms
cypress:cli checking if executable exists node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress +0ms
cypress:cli path to info.json file node_modules/cypress/dist/info.json +3ms
cypress:cli has verified version null +1ms
cypress:cli run verification check? true +0ms
cypress:cli running binary verification check 2.1.0 +0ms
It looks like this is your first time using Cypress: 2.1.0
cypress:cli writing verified version string "null" +3ms
cypress:cli path to info.json file node_modules/cypress/dist/info.json +3ms
cypress:cli path to info.json file node_modules/cypress/dist/info.json +1ms
cypress:cli running smoke test +3ms
cypress:cli using Cypress executable node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress +0ms
cypress:cli needs XVFB? false +0ms
cypress:cli smoke test command: node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=290 +0ms
✖ Verifying Cypress can run node_modules/cypress/dist/Cypress.app
→ Cypress Version: 2.1.0
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.
----------
----------
Platform: darwin (17.4.0)
Cypress Version: 2.1.0
I should just pass the verification step and start normally.
install it from npm and run cypress verify or cypress open
I tried to reproduce the smoke test step directly and got Segmentation Fault 11. If I go to the directory and open Cypress.app it opens normally.
Version 1.4.2 works as expected.
I already removed the node_modules directory and made a clean install but got the same result.
so something is really wrong during installation it seems. What happens when you
npm install cypress./node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress
Hi, @bahmutov. Thanks for your reply.
I did what you've asked. Here's the result:
sts-Manel:dev marcelodiniz$ mkdir check-cypress && cd - && npm init -y
/Users/marcelodiniz/dev/check-cypress
Wrote to /Users/marcelodiniz/dev/check-cypress/package.json:
{
"name": "check-cypress",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
sts-Manel:check-cypress marcelodiniz$ npm install cypress
> [email protected] postinstall /Users/marcelodiniz/dev/check-cypress/node_modules/cypress
> node index.js --exec install
Installing Cypress (version: 2.1.0)
✔ Downloaded Cypress
✔ Unzipped Cypress
✔ Finished Installation /Users/marcelodiniz/dev/check-cypress/node_modules/cypress/dist/Cypress.app
You can now open Cypress by running: node_modules/.bin/cypress open
https://on.cypress.io/installing-cypress
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
added 187 packages in 34.597s
sts-Manel:check-cypress marcelodiniz$ ./node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress
Segmentation fault: 11
sts-Manel:check-cypress marcelodiniz$
As you can see, it's not very different from the original problem :(
Just to mention, I'm using nodejs 8.9.0 managed by nodenv (https://github.com/nodenv/nodenv)
Having the same issue.
Operating System: OS Sierra
Cypress Version: 2.1
Browser Version: Chrome 65.0.3325.181
Node version: v8.5.0
It looks like this is your first time using Cypress: 2.1.0
✖ Verifying Cypress can run /Users/nvangiessel/projects/check-cypress/node_modules/cypress/dist/Cypress.app
→ Cypress Version: 2.1.0
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.
----------
----------
Platform: darwin (16.7.0)
Cypress Version: 2.1.0
Node[1] 29936 segmentation fault ./node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress
Any idea's on this issue guys? Would love to upgrade to newest version of Cypress. Same error occurs on our gitlab/docker. Platform: linux (Ubuntu Linux - 16.04).
If I directly open /Users/nvangiessel/projects/check-cypress/node_modules/cypress/dist/Cypress.app, it starts the app, but can't open/run tests via command line.
@nvangiessel can you paste your docker file if possible? I think chances to recreate segmentation fault are higher in Docker environment than on Darwin, because it does not happen
also @nvangiessel can you see if there is a crash report from Cypress Electron app when it starts in /tmp/Cypress by any chance?
@nvangiessel is there a message in /var/log/system.log after the segmentation fault?
@bahmutov
I've managed to start a new docker container locally (with our own Dockerfile) and install cypress on it without any problems. Found out that it had to do with a environment var which was set on my machine+build. If you set this ENV var, the installation fails:
export NODE_OPTIONS=--max_old_space_size=4096
@nvangiessel thanks for tracking this down, never heard of this Node option!
Ok on Darwin too this silently fails
$ NODE_OPTIONS=--max_old_space_size=4096 DEBUG=cypress:* npm run cypress:open
> [email protected] cypress:open /Users/gleb/git/cypress-test-tiny
> cypress open
cypress:cli cli starts with arguments ["/Users/gleb/.nvm/versions/node/v8.9.4/bin/node","/Users/gleb/git/cypress-test-tiny/node_modules/.bin/cypress","open"] +0ms
cypress:cli program parsing arguments +3ms
cypress:cli opening Cypress +1ms
cypress:cli parsed cli options {} +129ms
cypress:cli opening from options {"project":"/Users/gleb/git/cypress-test-tiny"} +0ms
cypress:cli command line arguments ["--project","/Users/gleb/git/cypress-test-tiny"] +1ms
cypress:cli verifying Cypress app +0ms
cypress:cli path to info.json file /Users/gleb/git/cypress-test-tiny/node_modules/cypress/dist/info.json +0ms
cypress:cli { version: '2.1.0', verifiedVersion: '2.1.0' } +16ms
cypress:cli installed version is 2.1.0 comparing to 2.1.0 +17ms
cypress:cli checking if executable exists /Users/gleb/git/cypress-test-tiny/node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress +0ms
cypress:cli path to info.json file /Users/gleb/git/cypress-test-tiny/node_modules/cypress/dist/info.json +2ms
cypress:cli has verified version 2.1.0 +2ms
cypress:cli run verification check? false +0ms
cypress:cli needs XVFB? false +0ms
cypress:cli spawning Cypress /Users/gleb/git/cypress-test-tiny/node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress +0ms
cypress:cli spawn args ["--project","/Users/gleb/git/cypress-test-tiny","--cwd","/Users/gleb/git/cypress-test-tiny"] { dev: undefined, detached: false, stdio: 'inherit' } +0ms
~/git/cypress-test-tiny on master
$ echo $?
0
Something for me to work on!
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
printenv
SET
NODE_OPTIONS environment variableunset NODE_OPTIONS # this is not the same as export NODE_OPTIONS=
set NODE_OPTIONS=
We have open issues for this being fixed that you can follow here:
NODE_OPTIONS should not exit 0: https://github.com/cypress-io/cypress/issues/1676 @marceloemanoel were you able to resolve your issue?
Hi @jennifer-shehane yes this solves the problem. Sorry I didn't comment about it before. You can close the issue.
Most helpful comment
@nvangiessel thanks for tracking this down, never heard of this Node option!
Ok on Darwin too this silently fails
Something for me to work on!