【问题标题】:Missing dependencies when running Cypress on Jenkins在 Jenkins 上运行 Cypress 时缺少依赖项
【发布时间】:2020-10-06 10:26:25
【问题描述】:

我正在尝试让 cypress 在远程服务器上的 jenkins 上运行(平台:linux(Alpine Linux - 3.7.0)。每次单击“立即构建”时,都会失败并显示以下消息:

+ npm install
npm WARN cypress_test@1.0.0 No repository field.

up to date in 1.217s
[Pipeline] sh (Run tests)
+ npx cypress run
It looks like this is your first time using Cypress: 4.7.0

[?25l[17:51:40]  Verifying Cypress can run /root/.cache/Cypress/4.7.0/Cypress [started]
[17:51:41]  Verifying Cypress can run /root/.cache/Cypress/4.7.0/Cypress [failed]
[?25hCypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------

spawn /root/.cache/Cypress/4.7.0/Cypress/Cypress ENOENT

----------

Platform: linux (Alpine Linux - 3.7.0)
Cypress Version: 4.7.0
[?25h[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE

赛普拉斯官方文档https://docs.cypress.io/guides/guides/continuous-integration.html#Advanced-setup 没有适合我的答案。

我缺少什么依赖项?安装 xvfb 没有帮助。

【问题讨论】:

  • 您是否尝试过使用他们建议的操作系统之一,而不是 alpine?
  • 我无法控制该 aws 服务器上使用的操作系统
  • 那你有没有看过例如github.com/cypress-io/cypress/issues/419?
  • 感谢您指出该线程 - 我没有遇到它。看来 Cypress+Jenkins 无法在 Alpine-linux 上运行。

标签: jenkins cypress alpine


【解决方案1】:

这是 Linux 机器中的常见错误。解决方案已在https://docs.cypress.io/guides/continuous-integration/introduction.html#Dependencies中提供

sudo yum install -y xorg-x11-server-Xvfb gtk2-devel gtk3-devel libnotify-devel GConf2 nss libXScrnSaver alsa-lib

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-04-24
    • 2021-10-26
    • 2018-01-27
    • 1970-01-01
    • 1970-01-01
    • 2018-01-15
    • 1970-01-01
    • 2014-05-24
    相关资源
    最近更新 更多