cypress: Do not exit with 0 when running with NODE_OPTIONS

bug

When using NODE_OPTIONS=--max_old_space_size=4096 Cypress run through CLI silently fails but the exit code is 0.

  • why is this option affecting the run?
  • why don’t we exit with 1?
  • why don’t we print the problem?
$ NODE_OPTIONS=--max_old_space_size=4096 DEBUG=cypress:* npm run cypress:open

> cypress-test-tiny@1.0.0 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

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 18 (10 by maintainers)

Most upvoted comments

On High Sierra cypress segfaults for me if NODE_OPTIONS=--max_old_space_size=4096 or if NODE_OPTIONS="".

I have to unset NODE_OPTIONS for cypress not to segfault.

Versions:

Cypress 3.1.0 macOS 10.13.6 node 10.8.0

Just got the same error on the latest Cypress version. I tried to unset NODE_OPTIONS , but it didn’t help much. How do I solve this problem?

Update: After a few attempts of re-installing, I was able to launch successfully it.

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

Cypress failed to start.

This may be due to a missing library or dependency. https://on.cypress.io/required-dependencies

Please refer to the error below for more details.

----------

dyld: Library not loaded: @rpath/Electron Framework.framework/Electron Framework
Referenced from: /Users/user/Library/Caches/Cypress/8.0.0/Cypress.app/Contents/MacOS/Cypress
Reason: no suitable image found.  Did find:
/Users/user/Library/Caches/Cypress/8.0.0/Cypress.app/Contents/MacOS/../Frameworks/Electron Framework.framework/Electron Framework: file too short
/Users/user/Library/Caches/Cypress/8.0.0/Cypress.app/Contents/MacOS/../Frameworks/Electron Framework.framework/Electron Framework: stat() failed with errno=1

----------

Platform: darwin (19.6.0)
Cypress Version: 8.0.0
Node Version: v16.3.0

Released in 3.3.0.

I also was able to start cypress again by unsetting the environment variable,

Node: 8.11.3 Darwin: 17.6.0 Cypress: 3.1.0

Pasting the error code so others may find this via google search.

> ../../node_modules/.bin/cypress open

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

 ✖  Verifying Cypress can run <redacted>/Library/Caches/Cypress/3.1.0/Cypress.app
   → Cypress Version: 3.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.
----------

Command failed: 
<redacted>/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=674
----------

Platform: darwin (17.6.0)
Cypress Version: 3.1.0