2017-05-23 119 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]