Gitlab CI失败:找不到NPM命令

mr.*_*r.b 8 javascript node.js gitlab gitlab-ci

我一直在玩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/*
Run Code Online (Sandbox Code Playgroud)

我一直收到下面的错误,我不知道为什么: 在此输入图像描述

顺便说一下,我没有使用gitlab共享运行器.不确定这是否有助于解决问题,但只是为了确保,拥有我的gitlab runner的机器具有运行nodejs所需的所有软件包.

非常感谢您的帮助

最好的祝福,

Amp*_*ter 6

image标签指定了一个 docker 映像,因此您必须将运行程序的执行程序指定为docker. 您shell是否在创建跑步者时将其设置为其他内容,例如?