Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypress failed to start on MacOS

When I try to use cypress open or cypress run, I get the following error:

 ✖  Verifying Cypress can run /*/*/.cache/Cypress/3.1.5/Cypress
   → Cypress Version: 3.1.5
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: /*/*/.cache/Cypress/3.1.5/Cypress/Cypress --smoke-test --ping=984
----------

Platform: darwin (17.6.0)
Cypress Version: 3.1.5

There are no dependencies listed in the error, and I'm not using docker. What should I try?

like image 329
bkucera Avatar asked Mar 07 '19 23:03

bkucera


People also ask

Why is Cypress not opening?

If you're having an issue during installation of Cypress, try removing the contents of the Cypress cache. This will clear out all installed versions of Cypress that may be cached on your machine. After running this command, you will need to run cypress install before running Cypress again.

How do I fix Cypress error?

This error occurs in CI when using cypress run without a valid Cypress binary cache installed on the system (on linux that's ~/. cache/Cypress ). To fix this error, follow instructions on caching the cypress binary in CI, then bump the version of your CI cache to ensure a clean build.

How do I open Cypress in terminal?

By passing --browser and --e2e or --component when launching a project, you can open Cypress and launch the browser at the same time.


2 Answers

Simply try ./node_modules/.bin/cypress install if you're using Cypress for the first time.

like image 83
Daniel Danielecki Avatar answered Oct 19 '22 12:10

Daniel Danielecki


One thing that worked for me was unsetting the NODE_OPTIONS environment variable:

on MacOS

unset NODE_OPTIONS
cypress open

on Windows

set NODE_OPTIONS=
cypress open

if that fails, try the following as suggested by a user on Github:

on MacOS:

  • clear /Users/[username]/Library/Caches/Cypress
  • run npm i cypress -g
  • run cypress open
  • close terminal
  • return back to your node.js project and run the tests

on Windows:

  • clear C:\Users[username]\AppData\Local\Cypress\Cache)
  • start a command prompt as administrator
  • run npm i cypress -g
  • run cypress open
  • close command prompt
  • return back to your node.js project and run the tests
like image 45
bkucera Avatar answered Oct 19 '22 12:10

bkucera