【问题标题】:Cypress unable to run in Jenkins?Cypress 无法在 Jenkins 中运行?
【发布时间】: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


【解决方案1】:

看来您确实已经上传了所有 node_modules,但您没有上传 Cypress 本身。 您是否尝试过运行npm install 或cypress install?

此外,仅供参考,Jenkins 只是一个持续集成工具。它可以帮助您管理任务。所有命令仍然只在您的服务器上运行:)

【讨论】:

  • Cypress 已安装,我可以看到它的版本。在这里,问题是找不到赛普拉斯二进制版本。由于我无法访问服务器,我正在寻找更新 cypress 二进制版本而不是使用 npm install/cypress install 的方法
猜你喜欢
  • 2019-04-15
  • 1970-01-01
  • 1970-01-01
  • 2021-12-15
  • 2020-10-06
  • 1970-01-01
  • 2012-01-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多