Cypress: Loading and Crashing issues with Cypress v3.0.1

Created on 4 Jun 2018  ยท  64Comments  ยท  Source: cypress-io/cypress

Current behavior:

When I try to run Cypress via npm I get the following:

C:\Users\aallford\Documents\elprd-risk-assessment-app>C:\Users\aallford\Documents\elprd-risk-assessment-app\node_modules\.bin\cypress run

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

 ร—  Verifying Cypress can run C:\Users\aallford\AppData\Local\Cypress\Cache\3.0.1\Cypress
   โ†’ Cypress Version: 3.0.1
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: win32 (6.3.9600)
Cypress Version: 3.0.1

ALSO
If I try to run Cypress from the local install of 3.0.1, it crashes when I try to run an integration test.

Desired behavior:

Cypress will open from npm, and not crash and close if run from local install

Steps to reproduce:

As Current behaviour

Versions

Cypress = v3.0.1
OS = Win 8
Browser = Chrome

windows

Most helpful comment

Same issue here after I installed Cypress as a dependency of my nodejs project. Finally found a workaround.

  1. clear C:\Users[username]\AppData\Local\Cypress\Cache
  2. start a command prompt as administrator
  3. run npm i cypress -g
  4. run cypress open (not sure if this is needed)
  5. close command prompt
  6. return back to your node.js project and run the tests

All 64 comments

I completely deleted my version of Cypress and installed it again and it is now working.

Still got an issue through npm though

@Stormdoodle looking into this, which files are you referring to "completely deleting my version of Cypress" ?

"Still got an issue through npm though"

Can you explain what you mean by this ?

@Bkucera I mean I uninstalled Cypress that was locally installed. Reinstalled it from the most recent (3.0.1) release and my local version is now working and allowing me to run integration tests.

My other issue (or the original issue) is when I try to launch Cypress from Visual Studio Code using node_modules\.bin\cypress run is still giving me an error:
capture

@Stormdoodle ok, strage that Cypress failed with a dependency error but didn't tell you which one. Can you run the following?

set DEBUG=cypress*
node_modules\.bin\cypress run

?

@Bkucera
I ran what you suggested and got the following:

C:\Users\aallford\Documents\elprd-risk-assessment-app>set DEBUG=cypress*

C:\Users\aallford\Documents\elprd-risk-assessment-app>node_modules\.bin\cypress run

  cypress:cli cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","C:\\Users\\aallford\\Documents\\elprd-risk-assessment-app\\node_modules\\cypress\\bin\\cypress","run"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli program parsing arguments +2ms
  cypress:cli running Cypress +1ms
  cypress:cli parsed cli options {} +328ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +1ms
  cypress:cli checking if executable exists C:\Users\aallford\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe +2ms
  cypress:cli binaryDir is  C:\Users\aallford\AppData\Local\Cypress\Cache\3.0.1\Cypress +1ms
  cypress:cli Found binary version 3.0.1 installed in: C:\Users\aallford\AppData\Local\Cypress\Cache\3.0.1\Cypress +3ms
  cypress:cli could not read binary_state.json file +0ms
  cypress:cli {} +1ms
  cypress:cli is Verified ? undefined +2ms
  cypress:cli running binary verification check 3.0.1 +1ms
It looks like this is your first time using Cypress: 3.0.1

  cypress:cli clearing out the verified version +2ms
  cypress:cli running smoke test +3ms
  cypress:cli using Cypress executable C:\Users\aallford\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe +0ms
  cypress:cli needs XVFB? false +1ms
  cypress:cli smoke test command: C:\Users\aallford\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe --smoke-test --ping=567 +0ms
 ร—  Verifying Cypress can run C:\Users\aallford\AppData\Local\Cypress\Cache\3.0.1\Cypress
   โ†’ Cypress Version: 3.0.1
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: win32 (6.3.9600)
Cypress Version: 3.0.1

@Stormdoodle thanks! How are you getting Cypress to work currently? You said you got it working, how are you running it, from where? How is that different than this failure?

@Bkucera I have a local install of Cypress (Direct Download install) and open my project solution from within the application. My project has 3.0.1 saved as a Dev dependency. My problem/issue is that I can't open Cypress from within Visual Studio Code using the npm/npx methods/

Same here

DEBUG=cypress* node_modules/.bin/cypress run

  cypress:cli cli starts with arguments ["/usr/local/Cellar/node/9.11.1/bin/node","/Users/filipenevola/Documents/quave/ws/bemarke/node_modules/.bin/cypress","run"] +0ms
  cypress:cli NODE_OPTIONS=--max-old-space-size=4096 +0ms
  cypress:cli program parsing arguments +3ms
  cypress:cli running Cypress +1ms
  cypress:cli parsed cli options {} +88ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +0ms
  cypress:cli checking if executable exists /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress +12ms
  cypress:cli binaryDir is  /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app +2ms
  cypress:cli Found binary version 3.0.1 installed in: /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app +2ms
  cypress:cli could not read binary_state.json file +0ms
  cypress:cli {} +0ms
  cypress:cli is Verified ? undefined +1ms
  cypress:cli running binary verification check 3.0.1 +0ms
It looks like this is your first time using Cypress: 3.0.1

  cypress:cli clearing out the verified version +2ms
  cypress:cli running smoke test +1ms
  cypress:cli using Cypress executable /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress +0ms
  cypress:cli needs XVFB? false +0ms
  cypress:cli smoke test command: /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=282 +1ms
 โœ–  Verifying Cypress can run /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app
   โ†’ Cypress Version: 3.0.1
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.6.0)
Cypress Version: 3.0.1

@Stormdoodle @filipenevola what are your node versions?

The problem in #1959 is isolated by running this commands in docker windows container mode:

C:\> docker run -it --rm stefanscherer/node-windows:8-nanoserver cmd
# switches into container
C:\> mkdir work
C:\> cd work
C:\work> npm i -y
C:\work> npm i --save-dev [email protected]
# till now everything works well
C:\work> set DEBUG=*
C:\work> node_modules\.bin\cypress verify

The node version is in this case node v8 but also fails with node v10.

@Bkucera

node --version
v9.11.1

I really want to try cypress out but the installation problems are real and I'm not able to get it running.

@filipenevola @SeriousM
There is a very good chance this is a permissions issue. We've got enhanced error logs coming out in the next release that should tell you the exact error.
I suspect you are downloading the Cypress binary as one user, and attempting to launch Cypress as another. This goes for Administrator privileges as well: in a Dockerfile you execute commands as root by default, and when you run the Cypress, you may not have root.
This is clearly an issue specific to your setup, and I'm sure that tweaking your environment will solve the issue.

For macos, try installing node via nvm, or another node versioning tool that installs node in the user space, not /usr/.... For @filipenevola the location of your node binary is suspect: usr/local/Cellar/node/9.11.1/bin/node

I suspect you are downloading the Cypress binary as one user, and attempting to launch Cypress as another. This goes for Administrator privileges as well: in a Dockerfile you execute commands as root by default, and when you run the Cypress, you may not have root.

I checked every single step and I'm always the same user (administrator).

@SeriousM can you try lauching the Cypress binary directly via .cache/Cypress/3.0.1/Cypress/Cypress.exe ? This might give you the reason Cypress failed to launch

can you try lauching the Cypress binary directly

I did, but sadly none of my tries exposed any result..

C:\work>C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe --smoke-test

C:\work>C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe --smoke-test --ping=573

C:\work>C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe --help

C:\work>C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe verify

C:\work>C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe

C:\work>dir C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.1\Cypress\Cypress.exe
 Volume in drive C has no label.
 Volume Serial Number is 74B0-DF79

 Directory of C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.1\Cypress

06/19/2018  06:16 AM        85,785,600 Cypress.exe
               1 File(s)     85,785,600 bytes
               0 Dir(s)  20,442,939,392 bytes free

Can any of you link us to the windows docker container you're using or maybe your docker script so we can reproduce on our end?

https://github.com/cypress-io/cypress/issues/1866#issuecomment-398027576

It's there, just a few posts before.

@Bkucera I'm running with nvm now:

cypress-validation nvm which current
/Users/filipenevola/.nvm/versions/node/v8.11.3/bin/node

and I got this error

โžœ  cypress-validation npm run cypress:open

> [email protected] cypress:open /Users/filipenevola/Documents/quave/ws/cypress-validation
> cypress open


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

 โœ–  Verifying Cypress can run /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app
   โ†’ Cypress Version: 3.0.1
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.6.0)
Cypress Version: 3.0.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] cypress:open: `cypress open`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] cypress:open script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/filipenevola/.npm/_logs/2018-06-19T21_31_28_131Z-debug.log

just to be clear, I run a lot of node projects in this machine without any problem, the only one that is not working is cypress and I see a lot of people complaining about this. Looks like there is something wrong on your end.

cypress promises to be the easiest solution that will make my life a lot easier with end-to-end testing but I'm not able to install it ๐Ÿ˜ž, I really want to try this out because I already implemented end-to-end tests with a lot of different tools but I already spent a lot of time trying to make cypress works and that is frustrating.

I don't know what else to do, I already read everything that I could find online and I already tried in my Ubuntu machine too, I also got problems there. I really don't believe the problem is on my end when everything except cypress is working fine.

If you have more alternatives for me to try I will be happy to do it.

/Users/filipenevola/.npm/_logs/2018-06-19T21_31_28_131Z-debug.log content below

0 info it worked if it ends with ok
1 verbose cli [ '/Users/filipenevola/.nvm/versions/node/v8.11.3/bin/node',
1 verbose cli   '/Users/filipenevola/.nvm/versions/node/v8.11.3/bin/npm',
1 verbose cli   'run',
1 verbose cli   'cypress:open' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'precypress:open', 'cypress:open', 'postcypress:open' ]
5 info lifecycle [email protected]~precypress:open: [email protected]
6 info lifecycle [email protected]~cypress:open: [email protected]
7 verbose lifecycle [email protected]~cypress:open: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~cypress:open: PATH: /Users/filipenevola/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/filipenevola/Documents/quave/ws/cypress-validation/node_modules/.bin:/Users/filipenevola/.nvm/versions/node/v8.11.3/bin:/Users/filipenevola/bin:/usr/local/bin:/Users/filipenevola/Library/Android/sdk:/Users/filipenevola/Library/Android/sdk/platform-tools:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle [email protected]~cypress:open: CWD: /Users/filipenevola/Documents/quave/ws/cypress-validation
10 silly lifecycle [email protected]~cypress:open: Args: [ '-c', 'cypress open' ]
11 silly lifecycle [email protected]~cypress:open: Returned: code: 1  signal: null
12 info lifecycle [email protected]~cypress:open: Failed to exec cypress:open script
13 verbose stack Error: [email protected] cypress:open: `cypress open`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/filipenevola/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/Users/filipenevola/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/filipenevola/Documents/quave/ws/cypress-validation
16 verbose Darwin 17.6.0
17 verbose argv "/Users/filipenevola/.nvm/versions/node/v8.11.3/bin/node" "/Users/filipenevola/.nvm/versions/node/v8.11.3/bin/npm" "run" "cypress:open"
18 verbose node v8.11.3
19 verbose npm  v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] cypress:open: `cypress open`
22 error Exit status 1
23 error Failed at the [email protected] cypress:open script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Same issue here after I installed Cypress as a dependency of my nodejs project. Finally found a workaround.

  1. clear C:\Users[username]\AppData\Local\Cypress\Cache
  2. start a command prompt as administrator
  3. run npm i cypress -g
  4. run cypress open (not sure if this is needed)
  5. close command prompt
  6. return back to your node.js project and run the tests

@filipenevola wow, I'm surprised that didn't work :disappointed:
Did you install the binary with nvm? Try deleting the ~/.cache/Cypress folder and installing with your node under nvm
Also can you try executing the binary directly from /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress ?

@lazytesting what node version are you on? I've never been able to reproduce this.

@Bkucera I got

โžœ  ~ /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app/Contents/MacOS/Cypress ; exit;
[1]    49987 segmentation fault 

I also cleaned the cache and installed it again but no luck

โžœ  bemarke git:(development) โœ— node_modules/.bin/cypress open

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

 โœ–  Verifying Cypress can run /Users/filipenevola/Library/Caches/Cypress/3.0.1/Cypress.app
   โ†’ Cypress Version: 3.0.1
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.6.0)
Cypress Version: 3.0.1

@Bkucera I'm running node v8.11.1 and npm 5.8.0 via NVM for Windows.

@filipenevola one more thing, Trying to see if we can get more info about the seg fault, can you execute the binary directly with DEBUG=cypress:* set?

Hi, here's an update with 3.0.2, done with the docker setup described above:

C:\>set DEBUG=cypress:*

C:\>cypress verify
  cypress:cli cli starts with arguments ["C:\\nodejs\\node.exe","C:\\nodejs\\node_modules\\cypress\\bin\\cypress","verify"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli program parsing arguments +0ms
  cypress:cli parsed cli options {} +0ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +0ms
  cypress:cli checking if executable exists C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress\Cypress.exe +0ms
  cypress:cli Binary is executable? : true +0ms
  cypress:cli binaryDir is  C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress +0ms
  cypress:cli Reading binary package.json from: C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress\resources\app\package.json +0ms
  cypress:cli Found binary version 3.0.2 installed in: C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress +0ms
  cypress:cli could not read binary_state.json file +15ms
  cypress:cli {} +0ms
  cypress:cli is Verified ? undefined +15ms
  cypress:cli force verify +0ms
  cypress:cli running binary verification check 3.0.2 +0ms
It looks like this is your first time using Cypress: 3.0.2

  cypress:cli clearing out the verified version +0ms
  cypress:cli running smoke test +0ms
  cypress:cli using Cypress executable C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress\Cypress.exe +0ms
  cypress:cli needs XVFB? false +0ms
  cypress:cli smoke test command: C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress\Cypress.exe --smoke-test --ping=259 +0ms
 \  Verifying Cypress can run C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress
  cypress:cli Smoke test failed: { Error: Command failed: C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress\Cypress.exe --smoke-test --ping=259


    at makeError (C:\nodejs\node_modules\cypress\node_modules\execa\index.js:172:9)
    at Promise.all.then.arr (C:\nodejs\node_modules\cypress\node_modules\execa\index.js:277:16)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  code: 3221225781,
  stdout: '',
  stderr: '',
  failed: true,
  signal: null,
  cmd: 'C:\\Users\\ContainerAdministrator\\AppData\\Local\\Cypress\\Cache\\3.0.2\\Cypress\\Cypress.exe --smoke-test --ping=259',
  timedOut: false,
 ?  Verifying Cypress can run C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress
   ? Cypress Version: 3.0.2
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: C:\Users\ContainerAdministrator\AppData\Local\Cypress\Cache\3.0.2\Cypress\Cypress.exe --smoke-test --ping=259
----------

Platform: win32 (10.0.17134)
Cypress Version: 3.0.2

Okay cool. We're making progress. Now we can at least see the exit code.

It appears there is more information from Electron regarding this here: https://github.com/electron/electron/issues/3570

Will investigate to see what can be done.

@SeriousM or @petertsu are either of your offline when running Cypress?

@SeriousM or @peterhry or @filipenevola are any of you trying to run Cypress from VSCode integrated terminal?

@brian-mann
I am trying to run from cmd terminal

C:\Users\Administrator>node --version
v10.4.1

C:\Users\Administrator>npm --version
6.1.0

C:\Users\Administrator>where cypress
C:\Users\Administrator\AppData\Roaming\npm\cypress
C:\Users\Administrator\AppData\Roaming\npm\cypress.cmd
C:\Users\Administrator\AppData\Local\Yarn\bin\cypress
C:\Users\Administrator\AppData\Local\Yarn\bin\cypress.cmd

So you're all experiencing the same problem which is good: Electron is exiting with exit code 3221225781

There are a bunch of issues over at Electron's github indicating this. I scanned through them but didn't really see any actionable steps. We really need to be able to reproduce this on our own machines so we can iterate on the problem.

A quick google pulls up a bunch of results here: https://www.google.com/search?q=electron+3221225781&oq=electron+3221225781&aqs=chrome..69i57j69i60l2.1334j0j4&sourceid=chrome&ie=UTF-8

I would suggest any/all of you read through those and try out some of the workarounds there. If any work, please report them back here and we'll see what changes we need to make.

@SeriousM or @petertsu are either of your offline when running Cypress?

No, I'm online and the docker container is online as well

@SeriousM or @peterhry or @filipenevola are any of you trying to run Cypress from VSCode integrated terminal?

Nope, just in cmd or powershell. same result.

@SeriousM @brian-mann

Hi
Good news :) I have installed Microsoft Visual C++ Redistributable for Visual Studio 2017 .
and after that uninstall cypress + delete all local cache and install cypress again .

C:\Users\Administrator>cypress verify
It looks like this is your first time using Cypress: 3.0.2
Verified Cypress! C:\Users\Administrator\AppData\Local\Cypress\Cache\3.0.2\Cypress

I guess I found the docker solution!

As described above there is a docker windows-image for node 8 called stefanscherer/node-windows:8-nanoserver. This image is not able to verify cypress.
There is another tagged image called stefanscherer/node-windows:8-build-tools which is basically the same with the difference of RUN npm install --global windows-build-tools.
The image stefanscherer/node-windows:8-build-tools IS able to verify cypress!

The downside of this: the windows-build-tools adds 3.77GB of additional data to the image, but who cares :)

@Bkucera follow below but I don't think that had any effect.

DEBUG=cypress:* /Users/filipenevola/Library/Caches/Cypress/3.0.2/Cypress.app/Contents/MacOS/Cypress
[1]    936 segmentation fault  DEBUG=cypress:* 

@filipenevola don't invoke the binary directly. Just set DEBUG=cypress:* npm install and then paste the output.

Make sure you're on 3.0.2

I've also followed the install instructions (on https://docs.cypress.io/guides/getting-started/installing-cypress.html#npm-install) using npm and yarn on Windows.

Both resulted in the "Cypress failed to start" error as discussed above and the closed duplicate thread. I see a lot of talk about Docker and saying that all required dependencies' are installed in the containers provided. Do I need to have docker installed to play Cypress?

Using 3.0.2 - just about to try installing Microsoft Visual C++ Redistributable for Visual Studio 2017

Cleared the cache and re-installed seems to have fix it. Dunno if stuff did previously was the actual fix, but a new cache was also needed, or if just clearing the cache was the actual fix.

Tried installing using npm, then using yarn. Both failed. Couldn't run the direct download as a path-length issue was thrown up (even tho I'm enabled for long paths); an unzipping issue rather than Cypress,

Installed VS C++ 2017 Redist and restarted. Still no joy.

Cleared cache and did a reinstall (when Cypress whinges after clearing cache). Cypress Opened fine....

I was able to recreate this on our internal Cypress' EC2 instance running Windows 10. I created a new directory and ran npm init, npm i --save-dev cypress then cypress open and this same error occurred.

I'm having the same issue with circleci-cli. Everything works locally and inside our Docker+Docker-Compose instance. I'm at a loss as to what the problem and why its restricted to circleci. What exactly does the smoke test do?

It doesn't do anything other than launch itself and exit with the same value you passed in which verifies that it's able to launch and run in the environment and that there are no missing dependencies

I finally figured it out. Looks like it was a rogue ENV variable setting DISPLAY to 10.

I'm having the same issue (Smoke test failed/Cypress failed to start) on macOS after running initial cypress open.

cypress 3.0.3
macOS High Sierra
iTerm

I tried running cypress from my package.json using the following script:

"test:e2e": "cypress run --spec 'e2e/**/*'",

It works if I remove the 'test:' part it works:

"e2e": "cypress run --spec 'e2e-test/**/*'",

The below solution worked, unfortunately now Cypress is installed globally. I see a lot of people suggesting solutions that have to do with Docker or Mac, please note that the issue is concerning Windows dev machines. The error message Cypress gives is not applicable.

Same issue here after I installed Cypress as a dependency of my nodejs project. Finally found a workaround.

  1. clear C:\Users[username]\AppData\Local\Cypress\Cache
  2. start a command prompt as administrator
  3. run npm i cypress -g
  4. run cypress open (not sure if this is needed)
  5. close command prompt
  6. return back to your node.js project and run the tests

Edit: I cleared my node modules and re-ran npm install, Cypress now opens with npx cypress open, I'm no longer getting the dependency error.

One of our devs was seeing this issue, turns out the only difference between his and my machine was he was using cmd, I was using PowerShell. Not sure why, but he switched to PowerShell and it solved the issue.

To me, the issue was only fixed after i) I cleared cypress cache, and then ii) I was forced to run cypress install. Nothing else seems to have fixed the issue, at least in my case.

I'm still not able to run cypress.

I already tried everything above many times.

My current error is:

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

 โœ–  Verifying Cypress can run /Users/filipenevola/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: /Users/filipenevola/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=898
----------

Platform: darwin (17.7.0)
Cypress Version: 3.1.0

It worked after doing this for me.
Step1: Delete the cache folder Library/Caches/Cypress/
Step2: Run cypress install npm command locally.

This will download and install cypress as a fresh copy.

I had the exact same problem, and installing " Microsoft Visual C++ Redistributable for Visual Studio 2017" resolved it. I had to also delete ..\AppData\Local\Cypress\Cache .

The problem didn't occur on a computer with the same setup which already had the 2017 Redistributable.

Add this to package.json:

"scripts": {
    "cypress": "cypress"
}

And run it with npm run cypress open (GUI) or npm run cypress run

This solution fixed the issue for me.

@filipenevola you should try unsetting the NODE_OPTIONS env var as @jkoop mentioned, since your logs indicate you have it set:

MacOS / Linux

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

DO NOT USE set NODE_OPTIONS= on MacOS/Linux


Windows

set NODE_OPTIONS=

DO NOT USE set NODE_OPTIONS= on MacOS/Linux

This is due to an Electron bug, where having NODE_OPTIONS set causes either a failure or arguments to be ignored. https://github.com/electron/electron/issues/12695#issuecomment-385826834

Wow. Thank you @Bkucera, now it worked. It seems like that was the issue since always. Now I can finally run cypress and really start to use it. Thank you again!

As I'm always using NODE_OPTIONS for other projects I'll have to always disable it for Cypress but better than nothing ;) at least now I can use Cypress.

Congrats @filipenevola . I do the same as you but it's still get the same error. Could you please show the final configuration?

_This is what i am doing:_

  • set NODE_OPTIONS=
  • cache clean --force
  • npm install
  • set DEBUG=cypress:*
  • cypress:run

Hi @linhsonit , I'm always running cypress like this
unset NODE_OPTIONS && cypress open

you can add this to your package.json
"cypress:open": "unset NODE_OPTIONS && cypress open"
and run with
yarn cypress:open

Awesome! Thank you @filipenevola . It's worked.
I am very happy now.

For me, what fixed it was intalling the Visual C++ redistributable :
https://support.microsoft.com/en-gb/help/2977003/the-latest-supported-visual-c-downloads

We did make a few updates recently to cypress verify, so please update to the latest version and retry - also post any DEBUG logs if it is still erroring.

I still have the problem on the latest release. It occurs randomly on Gitlab CI when running tests on an Ubuntu (16.04 in Docker) without using cache. Is it possible to bypass this verify check?

I cannot post any more log, as Cypress does not even start.

+ npm run cypress:run

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

[19:28:50]  Verifying Cypress can run /root/.cache/Cypress/3.3.1/Cypress [started]
[19:29:01]  Verifying Cypress can run /root/.cache/Cypress/3.3.1/Cypress [failed]
Cypress verification timed out.

This command failed with the following output:

/root/.cache/Cypress/3.3.1/Cypress/Cypress --smoke-test --ping=563

----------

Command failed: /root/.cache/Cypress/3.3.1/Cypress/Cypress --smoke-test --ping=563

----------

Platform: linux (Ubuntu Linux - 16.04)
Cypress Version: 3.3.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] cypress:run: `cypress run --key fae232b4-8625-419d-8df2-6dac9efb07c3 --browser chrome`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] cypress:run script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-06-27T19_29_01_361Z-debug.log

@marcenacp please enable debug logs as mentioned above when posting error logs

We will be closing this issue in favor of https://github.com/cypress-io/cypress/issues/4624 in order to direct better focus on the overall problem that is being described in several issues - please add any information about how we can reproduce this bug there. ๐Ÿ™

Also, if you are seeing the error code 3221225781 see this issue instead https://github.com/cypress-io/cypress/issues/4625

@jennifer-shehane I don't know if this would be helpful at this point. But a fix that happened for us for my co-worker that ran into the exact same error, using Docker on Macs is that we needed to bump up the memory in the Docker settings.
If you go to Docker preferences and click on Advanced, you can adjust the memory there.
My co-worker bumped it up to 5.0 GiB, and that solved his [cypress-test] Error 22.

Screen Shot 2019-08-07 at 11 05 36 AM

@sydneybarlow Please comment in the main issue in order to have all conversation in one place https://github.com/cypress-io/cypress/issues/4625

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamituel picture kamituel  ยท  66Comments

chrisbreiding picture chrisbreiding  ยท  114Comments

verheyenkoen picture verheyenkoen  ยท  84Comments

HugoGiraudel picture HugoGiraudel  ยท  97Comments

bahmutov picture bahmutov  ยท  69Comments