当我发出命令时:npx cypress open
出现以下错误:
Cypress cannot run because this binary file does not have executable permissions here:
/Users/gianmarx/Library/Caches/Cypress/5.4.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 (19.6.0)
Cypress Version: 5.4.0
我尝试安装它,但没有任何东西总是会给我这个错误。
如果我尝试清除缓存,则无法使用:
gianmarx@MBPdiGianmarco hoquLDesc % cypress cache clear
zsh: command not found: cypress
答案 0 :(得分:1)
我相信使用这些命令可以解决:
cd ../gianmarx/Library/Caches/Cypress
cypress cache clear
然后转到您必须启动cypress的项目,我可能应该重新安装cypress。我推荐此命令:
yarn add cypress faker --dev
然后尝试再次投射:
npx cypress open
答案 1 :(得分:0)
尝试在错误的文件中运行cypress时出现此错误。
请确保您在cypress文件上的位置正确,以解决此问题