问题描述
第一次尝试通过命令启动 Cypress 的 Test Runner - node_modules.bin\cypress open
但出现意外错误- 错误:EPERM:不允许操作,打开\TestAutomation\cypress.json'
解决方法
您没有提到那么多信息,而且您还错误地格式化了其中的一些信息,所以我的回答无法准确。
但是,我会这样做:
- 检查
cypress.json
是否有效 - 检查
package.json
是否有效 - 向
package.json
添加新脚本:
{
"scripts": {
"open": "cypress open"
}
}
然后运行 $ npm run open
- 清除 npm 缓存:
> npm cache clean --force
- 以管理员身份安装最新版本的 npm:
> npm install -g npm@latest