【发布时间】:2021-02-25 03:17:26
【问题描述】:
我正在尝试在我的工作场所使用 jenkins 运行 cypress 测试。由于代理问题,我在 s3 中上传了本地节点模块,在运行测试之前,我将下载这些模块,然后使用此命令运行测试。
但是我遇到了我不明白的错误。有人可以解释一下这里出了什么问题吗?
CYPRESS_CACHE_FOLDER=./cypress-cache ./node_modules/.bin/cypress run --headless --browser chrome --spec cypress/integration/api/api-test.spec.ts
The cypress npm package is installed, but the Cypress binary is missing.
We expected the binary to be installed here: /home/jenkins/agent/workspace/test-builds/cypress-ui-test-build/cypress-cache/6.1.0/Cypress/Cypress
Reasons it may be missing:
- You're caching 'node_modules' but are not caching this path: /home/jenkins/.cache/Cypress
- You ran 'npm install' at an earlier build step but did not persist: /home/jenkins/.cache/Cypress
Properly caching the binary will fix this error and avoid downloading and unzipping Cypress.
Alternatively, you can run 'cypress install' to download the binary again.
https://on.cypress.io/not-installed-ci-error
----------
Platform: linux (Debian- 9.9)
Cypress Version: 6.1.0
如果我尝试 ./node_modules/.bin/cypress --version
Cypress package version: 6.1.0
Cypress binary version: not installed
【问题讨论】:
-
我认为错误的意思是您没有安装 cypress。我之前在 Jenkins 中使用过 cypress,但我们总是为每个构建使用
npm install,并且 cyppress 是一个开发依赖项。错误状态“我们希望在此处安装二进制文件”,甚至提到运行npm install可能会修复它 -
@rmjoia 我无法访问服务器,所以我正在寻找其他方法来安装 cypress 二进制文件,而不是运行 npm install。
-
我多次遇到类似问题,但在我的本地机器上,AV 正在删除二进制文件,我尝试使用以前的版本并且工作正常,您是否尝试使用一个或多个以前的版本?跨度>
-
是的,我的旧版本似乎可以工作。但是由于我已经通过依赖项进行了更新,所以我需要使用新版本。你解决了吗?
标签: javascript api testing jenkins-pipeline cypress