【问题标题】:Cypress cannot run because this binary file does not have executable permissionsCypress 无法运行,因为此二进制文件没有可执行权限
【发布时间】:2021-06-23 14:32:45
【问题描述】:

我试图在 cypress 中创建一个新项目,但收到以下奇怪的错误消息。

步骤:

  1. npm init -y
  2. npm install cypress --save-dev

然后我做了npx open cypress,我从控制台收到以下消息

我该如何解决这个问题?

Cypress cannot run because this binary file does not have executable permissions here:

/Users/myName/Library/Caches/Cypress/7.5.0/Cypress.app/Contents/MacOS/Cypress

Reasons this may happen:

- node was installed as 'root' or with 'sudo'
- the cypress npm package as 'root' or with 'sudo'

Please check that you have the appropriate user permissions.

You can also try clearing the cache with 'cypress cache clear' and reinstalling.

----------

Platform: darwin (20.5.0)
Cypress Version: 7.5.0

【问题讨论】:

  • 你用 sudo 安装了 npm 吗?
  • 我不记得我可能有。怎么查?
  • 你能跑npm -v吗?
  • 版本号 7.12.1

标签: automation cypress


【解决方案1】:

你可以做两件事:

  1. 运行命令npm cypress cache clear,然后再次安装cypress npm install cypress --save-dev并检查。

  2. 或者,使用命令npm install -g 在不使用 sudo 的情况下全局安装 npm。然后新建一个文件夹,然后运行npm initnpm install cypress --save-devnpx cypress open

【讨论】:

  • 您好,安装正常,卡在reifyNode:node_modules/lodash
  • 先移除 npm。运行命令npm uninstall -g。如果这不起作用,请尝试使用 sudo npm uninstall -g,然后再试一次。
  • 我认为这可能是节点模块的事情。但在我继续前进之前,我已经向 cypress 提出了这个问题,因为我也希望得到他们的反馈,因为我以前从未经历过这种情况。
【解决方案2】:

因此,我与赛普拉斯的开发团队进行了交谈,得到了以下答案。阅读日志后,我感觉这可能是根本原因。所以请检查您是否拥有最新版本的 Node.js

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-24
    • 1970-01-01
    • 2016-04-02
    • 2020-12-21
    • 2013-08-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多