Codeship Basic npm install fails Error: SSL Error: CERT_UNTRUSTED

Codeship Basic npm install fails Error: SSL Error: CERT_UNTRUSTED

我一直遇到一个问题,我的 Codeship Basic 设置步骤在 运行 npm install:

时失败
npm http GET https://registry.npmjs.org/babel-runtime
npm ERR! Error: SSL Error: CERT_UNTRUSTED
npm ERR!     at ClientRequest.<anonymous> (/home/rof/.nvm/v0.6.21/lib/node_modules/npm/node_modules/request/main.js:440:26)
npm ERR!     at ClientRequest.g (events.js:156:14)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7)
npm ERR!     at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:91:29)
npm ERR!     at CleartextStream.socketOnData [as ondata] (http.js:1288:20)
npm ERR!     at CleartextStream._push (tls.js:375:27)
npm ERR!     at SecurePair.cycle (tls.js:734:20)
npm ERR!     at EncryptedStream.write (tls.js:130:13)
npm ERR!     at Socket.ondata (stream.js:38:26)
npm ERR!  [Error: SSL Error: CERT_UNTRUSTED]
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 4.2.0-42-generic
npm ERR! command "node" "/home/rof/.nvm/v0.6.21/bin/npm" "install"
npm ERR! cwd /home/rof/src/
npm ERR! node -v v0.6.21-pre
npm ERR! npm -v 1.1.37
npm ERR! message SSL Error: CERT_UNTRUSTED
npm http GET https://registry.npmjs.org/axios

相同的 npm install / package.json 在我的本地系统上没有问题。

我试图避免只禁用 SSL 证书验证,因为这似乎不是解决潜在问题的正确方法。

还有其他人在使用 Codeship 时看到过这个吗?

npm ERR! node -v v0.6.21-pre
npm ERR! npm -v 1.1.37

这似乎是节点版本的生命周期结束问题。

您是 运行 节点和 NPM 的旧版本,并且 SSL 已关闭。基本上,唯一的选择是使用非 SSL 注册表,或使用更新版本的 node/npm。

npm config set strict-ssl false

npm config set registry="http://registry.npmjs.org/"

I don't believe that the npm client included with Node 0.6 contains the necessary certificates to connect to the npm registry over SSL. SSL certificates expire, as you know, and so this is simply a natural consequence of using old software to connect to SSL servers, from what I understand.

我正在链接到 NPM 问题 - https://github.com/npm/npm/issues/4391