2016-12-28 130 views
0

我正在嘗試安裝我在Gitlab上託管的項目的依賴項,並且我的Runner從未完成安裝。它似乎試圖獲得依賴關係,但總是超時。這裏是我的.gitlab-ci.yml文件:Npm安裝在Gitlab持續集成中不成功

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會這樣失敗?

+0

可能是npmjs.org發生故障。我有多個NPM項目,都運行良好。你以後再嘗試嗎? – mohamnag

+0

只是再試一次,我仍然收到超時錯誤。 – rafafan2010

回答

0

我的公司有一個特定的鏡像,它希望我們用於npm包。當我確定時,一切正常。