当尝试制作LIST_DIRECTORIES
时,我们的Gitlab Runner工作总是中止。这意味着未找到或未安装npm。它将安装在上面,并且可以正常工作直到几天前。有人有主意吗?我将npm install
添加到附件中,我有点无奈...
gitlab-ci.yml
在'npm -g install eslint@v4.6.1 ember-cli yarn@v1.1.0 bower'行之后,出现以下错误: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
/bin/bash: line 103: npm: command not found
。
答案 0 :(得分:2)
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".
尝试改用ruby-node图片:
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