GitLab private runner stuck on npm install

2019-08-27 20:40发布

问题:

I'm trying to set up a CI pipeline on GitLab.com using a private runner instead of a shared one. The project uses Node, so I'm using a node:6 image.

The .gitlab-ci.yml looks like this:

image: node:6

stages:
    - test

javascript_tests:
    stage: test
    script:
        - npm install
        - npm run test:unit
    when: always

The runner stays on "running" stage for about 30 minutes and only then started to output something relevant:

npm ERR! fetch failed 
http://10.252.156.164:4880/@types%2fjsforce/-/jsforce-1.9.2.tgz
npm WARN retry will retry, error on last attempt: Error: connect ETIMEDOUT 10.252.156.164:4880

What can I do to solve this? I thought that installing gitlab-runner on a DigitalOcean droplet would be the only things to worry about.

回答1:

Replacing node:6 with node:latest fixed this problem.