Gitlab Runner作业失败

Gitlab Runner作业失败,gitlab,gitlab-ci,gitlab-ci-runner,Gitlab,Gitlab Ci,Gitlab Ci Runner,我们的Gitlab Runner作业在尝试进行npm安装时总是中止。这意味着未找到或安装npm。它将安装在上面,直到几天前才能正常工作。有人有主意吗?我将我们的gitlab ci.yml添加到附件中,我有点无助 image: "ruby:2.5.5" variables: RAILS_ENV: "test" GIT_DEPTH: "1" APT_PACKAGES: "nodejs postgresql postgresql-contrib libpq-dev sudo fontco

我们的Gitlab Runner作业在尝试进行
npm安装时总是中止。这意味着未找到或安装npm。它将安装在上面,直到几天前才能正常工作。有人有主意吗?我将我们的
gitlab ci.yml
添加到附件中,我有点无助

image: "ruby:2.5.5"

variables:
  RAILS_ENV: "test"
  GIT_DEPTH: "1"
  APT_PACKAGES: "nodejs postgresql postgresql-contrib libpq-dev sudo fontconfig bzip2 curl libxss1 libappindicator1 libindicator7 libpango1.0-0 fonts-liberation xdg-utils cmake"

cache:
  key: "ruby-255"
  paths:
  - vendor/ruby
  - vendor/apt
  - node_modules
  - frontend/node_modules
  - frontend/bower_components

before_script:
  # Setup deploy key
  - mkdir -pv ~/.ssh
  - echo "StrictHostKeyChecking no" >> ~/.ssh/config
  - eval $(ssh-agent -s)
  - ssh-add <(echo "$DEPLOY_KEY")

  # Install dependencies
  - mkdir -pv vendor/apt
  - curl -sL https://deb.nodesource.com/setup_8.x | bash -
  - apt-get -o dir::cache::archives="vendor/apt" update -yqqq
  - apt-get -o dir::cache::archives="vendor/apt" install -y -qq --force-yes --no-install-recommends $APT_PACKAGES

  # Setup phantomjs
  - curl --silent --show-error --location --fail --retry 3 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar xjfO - phantomjs-2.1.1-linux-x86_64/bin/phantomjs > /usr/bin/phantomjs && chmod +x /usr/bin/phantomjs

  # Install node packages, gems and tools, configure and run bundler
  - gem install bundler
  - npm -g install eslint@v4.6.1 ember-cli yarn@v1.1.0 bower
  - RAILS_ENV=test bundle install --path vendor --without development --jobs $(nproc) "${FLAGS[@]}"
  - RAILS_ENV=test bundle lock --add-platform java

  # Setup postgresql database
  - /etc/init.d/postgresql start
  - sudo -u postgres psql -U postgres -d postgres -c "alter user postgres with password 'postgres';"

  # Setup the build
  - cp .env.ci .env
  - RAILS_ENV=test bin/build

stages:
  - check

setup:
  stage: check
  script:
    - node -v
    - npm -v
    - ruby -v
    - bin/check
image:“ruby:2.5.5”
变量:
RAILS_ENV:“测试”
吉特深度:“1”
APT_软件包:“nodejs postgresql postgresql contrib libpq dev sudo fontconfig bzip2 curl libxss1 libappindicator1 libindicator7 libpango1.0-0字体解放xdg utils cmake”
隐藏物:
键:“ruby-255”
路径:
-供应商/红宝石
-供应商/apt
-节点单元
-前端/节点单元模块
-前端/鲍尔_组件
在脚本之前:
#安装部署密钥
-mkdir-pv~/.ssh
-echo“StrictHostKeyChecking no”>>~/.ssh/config
-eval$(ssh代理-s)
-ssh添加/usr/bin/phantomjs&&chmod+x/usr/bin/phantomjs
#安装节点包、gems和工具,配置并运行bundler
-gem安装绑定器
-npm-g安装eslint@v4.6.1余烬cliyarn@v1.1.0凉亭
-RAILS_ENV=测试包安装--路径供应商--无开发--作业$(nproc)“${FLAGS[@]}”
-RAILS\u ENV=测试包锁--添加java平台
#设置postgresql数据库
-/etc/init.d/postgresql start
-sudo-u postgres psql-u postgres-d postgres-c“使用密码'postgres'更改用户postgres”
#设置生成
-cp.env.ci.env
-RAILS_ENV=测试箱/构建
阶段:
-检查
设置:
阶段:检查
脚本:
-节点-v
-npm-v
-ruby-v
-垃圾箱/支票
在生产线“npm-g”安装之后eslint@v4.6.1余烬cliyarn@v1.1.0bower'出现以下错误:
/bin/bash:line 103:npm:command not found
错误:作业失败:退出代码1

我的Gitlab版本:

您使用的ruby:2.5.5
图像不包含npm可执行文件:

docker run -it --rm ruby:2.5.5 npm -version
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \"npm\": executable file not found in $PATH".
请尝试改用图像:

docker run -it --rm starefossen/ruby-node /bin/bash -c "ruby -v; node -v; npm -v"
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
v10.8.0
6.2.0

谢谢,就这样。