Search code examples
e2e-testingcypress

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?


Solution

  • 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