赛普拉斯无法在 MacOS 上启动

bku*_*era 5 e2e-testing cypress

当我尝试使用cypress openor 时cypress run,出现以下错误:

 ?  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
Run Code Online (Sandbox Code Playgroud)

错误中没有列出依赖项,而且我没有使用 docker。我应该尝试什么?

Dan*_*cki 8

./node_modules/.bin/cypress install如果您是第一次使用 Cypress,只需尝试一下即可。


bku*_*era 4

对我有用的一件事是取消设置NODE_OPTIONS环境变量:

在 MacOS 上

unset NODE_OPTIONS
cypress open
Run Code Online (Sandbox Code Playgroud)

在 Windows 上

set NODE_OPTIONS=
cypress open
Run Code Online (Sandbox Code Playgroud)

如果失败,请按照Github 上用户的建议尝试以下操作:

在 MacOS 上:

  • 清除/Users/[username]/Library/Caches/Cypress
  • 跑步npm i cypress -g
  • 跑步cypress open
  • 关闭终端
  • 返回您的 node.js 项目并运行测试

在 Windows 上:

  • 清除C:\Users[username]\AppData\Local\Cypress\Cache
  • 以管理员身份启动命令提示符
  • 跑步npm i cypress -g
  • 跑步cypress open
  • 关闭命令提示符
  • 返回您的 node.js 项目并运行测试