2017-05-23 118 views
0

我在CircleCI上有一個項目,該項目在某個時候開始變紅(由於未能安裝dredd)。目前相同的確切項目(相同的代碼,相同的circle.yml)可能會失敗或隨機成功。由於npm錯誤,npm install -g dredd @ stable在CircleCI上失敗!代碼ECONNRESET

的失敗總是在階段「故宮安裝-g的Dredd @穩定」具有下列錯誤,重演幾次,最終失敗的構建:

make: Leaving directory `/opt/circleci/nodejs/v4.2.6/lib/node_modules/dredd/node_modules/dredd-transactions/node_modules/fury-adapter-apib-parser/node_modules/drafter/node_modules/protagonist/build' npm ERR! Linux 3.13.0-117-generic npm ERR! argv "/opt/circleci/nodejs/v4.2.6/bin/node" "/opt/circleci/nodejs/v4.2.6/bin/npm" "install" "-g" "[email protected]" npm ERR! node v4.2.6 npm ERR! npm v2.14.12 npm ERR! code ECONNRESET npm ERR! errno ECONNRESET npm ERR! syscall read npm ERR! network read ECONNRESET 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'

如果我嘗試重新運行建立幾次它會在某個時候成功(走向綠色)。隨後的Dredd安裝顯示出來是這樣的:

make: Leaving directory `/opt/circleci/nodejs/v4.2.6/lib/node_modules/dredd/node_modules/dredd-transactions/node_modules/fury-adapter-apib-parser/node_modules/drafter/node_modules/protagonist/build' /opt/circleci/nodejs/v4.2.6/bin/dredd -> /opt/circleci/nodejs/v4.2.6/lib/node_modules/dredd/bin/dredd [email protected] /opt/circleci/nodejs/v4.2.6/lib/node_modules/dredd ├── [email protected] ├── [email protected] ├── [email protected]

等」,基本上安裝的Dredd成功並移到測試構建。

由於它似乎隨機失敗,我不認爲代理與它有任何關係。下面是引用circle.yml文件:

machine: environment: APIARY_API_KEY: "123456789ab12cd1234a1a1a123a123a" ruby: version: 2.3.1 dependencies: pre: - npm install -g [email protected] - gem install apiaryio - pip install dredd_hooks database: override: - bundle exec rake db:create db:schema:load db:seed test: pre: - apiary fetch --api-name=ourAPIName --output=api-description.yml - dredd

任何幫助將是非常受歡迎的。

+0

它看起來像故宮註冊表中的某些連接問題。我會聯繫CircleCI支持來解決這個問題。 –

+0

你有沒有試過紗線,看看是否有助於建立穩定性? – FelicianoTech

回答

0

我遇到了同樣的問題。我發現的一個修補程序是將npm的註冊表更改爲使用HTTP而不是HTTPS。在我circle.yml文件我改變了我的依賴從:

dependencies: 
    pre: 
    - npm install -g [email protected] 

dependencies: 
    pre: 
    - npm config set registry http://registry.npmjs.org/ 
    - npm install -g [email protected]