首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Cypress:无法安装二进制文件

Cypress:无法安装二进制文件
EN

Stack Overflow用户
提问于 2020-08-26 11:33:26
回答 3查看 2.4K关注 0票数 3

我正在尝试使用二进制文件安装cypress。当前在vs代码中使用以下命令:CYPRESS_INSTALL_BINARY=C:\Users\abcd\Downloads\cypress.zip npm install cypress

来源:https://docs.cypress.io/guides/getting-started/installing-cypress.html#Install-binary

这对我不起作用,显示以下错误:

代码语言:javascript
复制
CYPRESS_INSTALL_BINARY=C:\Users\abcd\Downloads\cypress.zip : The term 'CYPRESS_INSTALL_BINARY=C:\Users\abcd\Downloads\cypress.zip' is not recognized as the name of a cmdlet, function, script file, or operable program. 
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ CYPRESS_INSTALL_BINARY=C:\Users\abcd\Downloads\cypress.zip npm ins ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (CYPRESS_INSTALL...ads\cypress.zip:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

有谁能帮我解决这个问题吗?谢谢!

EN

回答 3

Stack Overflow用户

发布于 2021-02-04 22:01:28

我用几个npm命令修复了这个问题:

代码语言:javascript
复制
    "e2e": "npm run e2e:installcypress && npm run e2e:run && npm run e2e:coverage",
    "e2e:installcypress": "CYPRESS_INSTALL_BINARY=/path/to/cypress.zip npm install cypress",
    "e2e:run": "ng e2e",
    "e2e:coverage": "npx nyc report --reporter=lcov --reporter=html",

现在npm run e2e完成了所有3项工作

票数 0
EN

Stack Overflow用户

发布于 2021-10-07 06:31:41

试试这个-

代码语言:javascript
复制
set CYPRESS_INSTALL_BINARY=\your\path\to\cypress.x.x.x.zip

npm install cypress

npx cypress open
票数 0
EN

Stack Overflow用户

发布于 2020-08-26 11:47:18

Cypress二进制安装

安装与默认npm包不同的版本。

CYPRESS_INSTALL_BINARY=2.0.1 npm install cypress@2.0.3

指定外部URL (绕过公司防火墙)。

CYPRESS_INSTALL_BINARY=https://company.domain.com/cypress.zip npm install cypress

指定要在本地安装的文件,而不是使用internet。

CYPRESS_INSTALL_BINARY=/local/path/to/cypress.zip npm install cypress

在work...by上设置UNIX就像windows cmd上的路径一样

SET CYPRESS_INSTALL_BINARY=C:/Users/myUserName/Downloads/cypress.zip

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63590087

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档