2017-06-15 64 views
1

我有一個一致的問題,即我的Codeship基本設置步驟失敗:Codeship基本NPM安裝失敗錯誤:SSL錯誤:運行時<code>npm install</code> CERT_UNTRUSTED

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!  <[email protected]> 

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時看到了這一點?

回答

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

這似乎是節點版本的生命結束問題。

您正在運行舊版本的節點和NPM,並且SSL get關閉。基本上唯一的選擇是使用非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

+1

感謝凱利,這是一個總的笨蛋舉動。我曾打算指定節點'6.x'而不是'0.6.x',杜。更新到6.x解決了我的問題。 – krsyoung

+0

耶!很高興它的工作! –