Travis CI错误:未下载Chromium版本。运行“ npm install”或“ yarn install”

问题描述 投票:-1回答:1

我有一个测试套件,可以在本地设置上完美运行,这是库:https://github.com/IbrahimTanyalcin/RafX

但是我无法在Travis CI上使用它,但我不断得到:“未下载Chromium版本”

这是我的yml文件:https://github.com/IbrahimTanyalcin/RafX/blob/master/.travis.yml

language: node_js
dist: trusty
addons:
  apt:
    packages:
      # This is required to run new chrome on old trusty
      - libnss3
notifications:
  email: false
cache:
  directories:
    - node_modules
sudo: required
node_js:
  - "12.13.0"
env:
  #global:
  #  - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=0
# allow headful tests
before_install:
  # Enable user namespace cloning
  - "sysctl kernel.unprivileged_userns_clone=1"
  # Launch XVFB
  - "export DISPLAY=:99.0"
  # - export CHROME_PATH="$(pwd)/chrome-linux/chrome"
  - "sh -e /etc/init.d/xvfb start"
  # wait for xvfb to boot 
  - sleep 3 
  # start your web application and listen on `localhost`
  # - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
install:
  - npm install
  - npm install -g puppeteer --unsafe-perm=true --allow-root
  # - yarn add --dev jest-puppeteer
  # - yarn add puppeteer
script:
  - npm run testCI

这是失败的版本https://travis-ci.org/IbrahimTanyalcin/RafX

[我注释掉了我尝试过的一些选项,我几乎到处都检查过,包括操纵up和玩笑的文档,并实际上采用了他们推荐的yml文件。

我也尝试在此线程中应用建议,但无济于事:https://github.com/puppeteer/puppeteer/issues/2173

知道如何解决这个问题?

continuous-integration jestjs yaml travis-ci puppeteer
1个回答
0
投票

对于任何为此感到苦恼的人,似乎我已经在您的before install中找到了解决方法:

before_install:
  - node node_modules/puppeteer/install.js

如果添加这些行,您是在手动调用节点来安装puppeteer,但我不知道npm install为何失败,但这似乎可以解决问题。

© www.soinside.com 2019 - 2024. All rights reserved.