cypress: Dependencies missing while using your docker image

Current behavior:

I am trying to integrate cypress into our deployment process and I am using one of the your docker images for that (base:8 also tried a chrome one) It runs perfectly on my laptop but when i am deploying to the server it gives this error

up to date in 1.239s
It looks like this is your first time using Cypress: 2.1.0

[21:26:18]  Verifying Cypress can run /usr/src/app/node_modules/cypress/dist/Cypress [started]
[21:26:19]  Verifying Cypress can run /usr/src/app/node_modules/cypress/dist/Cypress [failed]
[21:26:19] → 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: linux (Debian - 8.10)
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: linux (Debian - 8.10)
Cypress Version: 2.1.0

Desired behavior:

I want it to not fail

How to reproduce:

I am not sure maybe try to run it in a container on a remote server

  • Operating System: ubuntu 14.04
  • Cypress Version: 2.1.0
  • Browser Version: headless

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 33 (9 by maintainers)

Most upvoted comments

I’m finally able to resolve my issue and now Cypress is working fine for me.

Following environment variable was being set DISPLAY=:1.5

Unsetting this variable solved my problem. I hope this help someone else as well.

You can verify if you have value set in DISPLAY, by running the following command: echo $DISPLAY

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:

We’re having this issue as well. It was working fine on v3.1.0 for a while, but it’s randomly stopped working both locally and on our CI env. Here’s the log from me trying to run cypress locally:

$ DEBUG=cypress* node_modules/.bin/cypress verify
  cypress:cli cli starts with arguments ["/usr/local/Cellar/node/10.5.0/bin/node","/Users/user/project/node_modules/.bin/cypress","verify"] +0ms
  cypress:cli NODE_OPTIONS=--max_old_space_size=8192 +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 /Users/user/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress +3ms
  cypress:cli Binary is executable? : true +1ms
  cypress:cli binaryDir is  /Users/user/Library/Caches/Cypress/3.1.0/Cypress.app +0ms
  cypress:cli Reading binary package.json from: /Users/user/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/Resources/app/package.json +0ms
  cypress:cli Found binary version 3.1.0 installed in: /Users/user/Library/Caches/Cypress/3.1.0/Cypress.app +3ms
  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.0 +0ms
It looks like this is your first time using Cypress: 3.1.0

  cypress:cli clearing out the verified version +4ms
  cypress:cli running smoke test +1ms
  cypress:cli using Cypress executable /Users/user/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress +0ms
  cypress:cli needs XVFB? false +0ms
  cypress:cli smoke test command: /Users/user/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=920 +0ms
  cypress:cli Smoke test failed: { Error: Command failed: /Users/user/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=920


    at makeError (/Users/user/project/node_modules/cypress/node_modules/execa/index.js:172:9)
    at Promise.all.then.arr (/Users/user/project/node_modules/cypress/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:
   '/Users/user/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=920',
  timedOut: false,
  killed: false } +48ms
 ✖  Verifying Cypress can run /Users/user/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/user/Library/Caches/Cypress/3.1.0/Cypress.app/Contents/MacOS/Cypress --smoke-test --ping=920
----------

Platform: darwin (17.5.0)
Cypress Version: 3.1.0
$ npm -v
6.1.0
$ yarn -v
1.7.0
$ node -v
v10.5.0

Running open and run don’t work either. I’ve tried uninstalling/reinstalling, doing yarn cache clean, deleting node_modules and doing a fresh install altogether, even tried installing previous version 3.0.3, but nothing has seemed to get this running again. Is there any workaround or solution for this?

Thank you!

I’m also facing the same issue:

✖  Verifying Cypress can run /root/.cache/Cypress/3.1.0/Cypress
   → 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: /root/.cache/Cypress/3.1.0/Cypress/Cypress --smoke-test --ping=280
----------

Platform: linux (Debian - 8.8)
Cypress Version: 3.1.0

Could you please provide a solution to this ?

The problem is with how I placed the images for docker. The cypress image needs to be first

Not docker related but I fixed this error by unsetting the NODE_OPTIONS var. https://github.com/cypress-io/cypress/issues/2431#issuecomment-418524647