Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab CI Failed: NPM command not found

I have been playing around Gitlabl CI but for some reason I can't get my tests to "passed". It always says npm: command not found

My Gitlab CI config looks like this:

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/*

I keep getting the error below and I have No Idea why: enter image description here

By the way, Im NOT using the gitlab shared runner. Not sure if that contributes to the problem but just to make sure, the machine that has my gitlab runner has all the necessary packages to run nodejs.

Your help is greatly appreciated

Best regards,

like image 714
mr.b Avatar asked Jun 26 '17 07:06

mr.b


1 Answers

The image tag specifies a docker image, hence you must specify the executor of your runner to be docker. Did you perhaps set it to be something else, like shell, when you created the runner?

like image 103
Amposter Avatar answered Oct 17 '22 04:10

Amposter