Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upgrade to version 2.0 and above #1434

Closed
marceloemanoel opened this issue Mar 8, 2018 · 13 comments
Closed

Can't upgrade to version 2.0 and above #1434

marceloemanoel opened this issue Mar 8, 2018 · 13 comments

Comments

@marceloemanoel
Copy link
Contributor

marceloemanoel commented Mar 8, 2018

  • Operating System: OS X High Sierra
  • Cypress Version: 2.0 and above
  • Browser Version: Chrome 64

Is this a Feature or Bug?

Bug

Current behavior:

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

Desired behavior:

I should just pass the verification step and start normally.

How to reproduce:

install it from npm and run cypress verify or cypress open

Additional Info (images, stack traces, etc)

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.

@marceloemanoel marceloemanoel changed the title Can't upgrade to versions above 2.0 Can't upgrade to version 2.0 and above Mar 8, 2018
@bahmutov
Copy link
Contributor

so something is really wrong during installation it seems. What happens when you

  • create new empty folder
  • install Cypress with npm install cypress
  • run Cypress binary directly
./node_modules/cypress/dist/Cypress.app/Contents/MacOS/Cypress

@bahmutov bahmutov added the stage: needs information Not enough info to reproduce the issue label Apr 20, 2018
@marceloemanoel
Copy link
Contributor Author

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

> cypress@2.1.0 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 check-cypress@1.0.0 No description
npm WARN check-cypress@1.0.0 No repository field.

+ cypress@2.1.0
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 :(

@marceloemanoel
Copy link
Contributor Author

Just to mention, I'm using nodejs 8.9.0 managed by nodenv (https://github.com/nodenv/nodenv)

@nvangiessel
Copy link

nvangiessel commented Apr 24, 2018

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

@nvangiessel
Copy link

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.

@bahmutov bahmutov self-assigned this May 2, 2018
@bahmutov
Copy link
Contributor

bahmutov commented May 2, 2018

@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

@bahmutov
Copy link
Contributor

bahmutov commented May 2, 2018

also @nvangiessel can you see if there is a crash report from Cypress Electron app when it starts in /tmp/Cypress by any chance?

@bahmutov
Copy link
Contributor

bahmutov commented May 2, 2018

@nvangiessel is there a message in /var/log/system.log after the segmentation fault?

@nvangiessel
Copy link

nvangiessel commented May 3, 2018

@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

@bahmutov
Copy link
Contributor

bahmutov commented May 3, 2018

@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

> 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

Something for me to work on!

@jennifer-shehane
Copy link
Member

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. electron/electron#12695 (comment)

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:

@jennifer-shehane
Copy link
Member

@marceloemanoel were you able to resolve your issue?

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: work in progress labels Mar 8, 2019
@marceloemanoel
Copy link
Contributor Author

Hi @jennifer-shehane yes this solves the problem. Sorry I didn't comment about it before. You can close the issue.

@jennifer-shehane jennifer-shehane removed the stage: awaiting response Potential fix was proposed; awaiting response label Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants