我一直在玩Gitlabl CI,但出于某种原因,我无法通过"通过"。它总是说npm: command not found
我的Gitlab CI配置如下所示:
image: node:latest
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
before_script:
- npm install
- npm install eslint -g
- npm install eslint-plugin-react -g
- npm install babel-eslint -g
test:lint:
script:
- eslint src/*
顺便说一下,我没有使用gitlab共享运行器。不确定这是否会导致问题,但只是为了确保,我的gitlab运行器的机器具有运行nodejs所需的所有软件包。
非常感谢您的帮助
致以最诚挚的问候,
答案 0 :(得分:3)
image
标记指定了泊坞窗图像,因此您必须将跑步者的执行者指定为docker
。您是否在创建跑步者时将其设置为其他内容,例如shell
?
答案 1 :(得分:1)
您可以如下使用:-
阶段: -建立 -部署
部署产品: 图片:节点:12.13.0-高山 阶段:部署 脚本: -npm i -g firebase-tools
答案 2 :(得分:0)
这对我有帮助:
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
答案 3 :(得分:0)
您的 cli 默认使用 ssh 执行程序。你可能需要码头工人。尝试在 yml 脚本中添加标签。
tags: [ <your docker image name> ]