Gitlab 持续集成中 npm install 不成功

Npm install doesn't succeed in Gitlab Continuous Integration

我正在尝试为我在 Gitlab 上托管的项目安装依赖项,但我的 Runner 从未完成安装。似乎试图获取依赖项,但总是超时。这是我的 .gitlab-ci.yml 文件:

image: node:4.6.0

test_job:
  script:
    - hostname
    - npm config list
    - npm install
    - echo "After install"
only:
- master

输出如下所示:

npm info attempt registry request try #3 at 3:06:54 PM
npm http request GET https://registry.npmjs.org/babel-register
npm info attempt registry request try #3 at 3:06:54 PM
npm http request GET https://registry.npmjs.org/babel-preset-stage-2
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.12.162:443
npm info retry will retry, error on last attempt: Error: connect ETIMEDOUT 151.101.12.162:443

最后,在尝试取回包裹 15 分钟后:

npm ERR! Linux 4.4.19-rancher
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 151.101.12.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

我不认为这是代理问题,因为这个 Runner 是 运行 在 Gitlab 托管的 Docker 容器中,但除此之外,我不知道问题是什么。为什么 npm install 总是这样失败?

我的公司有一个特定的镜像,它希望我们将其用于 npm 包。当我设置它时,一切正常。