首页 > npm 设置淘宝的npm源后更新包提示证书错误

npm 设置淘宝的npm源后更新包提示证书错误

设置npm源为registry.npm.taobao.org更新部分包时提示证书错误
164 http GET https://registry.npm.taobao.org/connect/1.8.5
165 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
166 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
167 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
168 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
169 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
170 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
171 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
172 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
173 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
174 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
175 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
176 info trying registry request attempt 2 at 08:02:18
177 http GET https://registry.npm.taobao.org/istanbul
178 info trying registry request attempt 2 at 08:02:18
179 http GET https://registry.npm.taobao.org/grunt-cli/0.1.13
180 info trying registry request attempt 2 at 08:02:18
181 http GET https://registry.npm.taobao.org/grunt-contrib-clean/0.6.0
182 info trying registry request attempt 2 at 08:02:18
183 http GET https://registry.npm.taobao.org/grunt-contrib-jshint/0.10.0
184 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
185 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
186 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
187 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
188 info trying registry request attempt 2 at 08:02:18
189 http GET https://registry.npm.taobao.org/jasmine-node/1.14.5
190 info trying registry request attempt 2 at 08:02:18
191 http GET https://registry.npm.taobao.org/mkdirp
192 info trying registry request attempt 2 at 08:02:18
193 http GET https://registry.npm.taobao.org/open/0.0.5
194 info trying registry request attempt 2 at 08:02:18
195 http GET https://registry.npm.taobao.org/jsdom-no-contextify
196 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
197 info trying registry request attempt 2 at 08:02:18
198 http GET https://registry.npm.taobao.org/browserify/10.1.3
199 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
200 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
201 info trying registry request attempt 2 at 08:02:18
202 http GET https://registry.npm.taobao.org/connect/1.8.5
203 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
204 info trying registry request attempt 2 at 08:02:18
205 http GET https://registry.npm.taobao.org/grunt/0.4.1
206 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
207 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
208 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
209 info trying registry request attempt 3 at 08:03:18
210 http GET https://registry.npm.taobao.org/istanbul
211 info trying registry request attempt 3 at 08:03:18
212 http GET https://registry.npm.taobao.org/grunt-cli/0.1.13
213 info trying registry request attempt 3 at 08:03:18
214 http GET https://registry.npm.taobao.org/grunt-contrib-clean/0.6.0
215 info trying registry request attempt 3 at 08:03:18
216 http GET https://registry.npm.taobao.org/grunt-contrib-jshint/0.10.0
217 info trying registry request attempt 3 at 08:03:18
218 http GET https://registry.npm.taobao.org/jasmine-node/1.14.5
219 silly lockFile 28997503-grunt-cli-0-1-13 grunt-cli@0.1.13
220 silly lockFile 28997503-grunt-cli-0-1-13 grunt-cli@0.1.13
221 silly lockFile 0a668ef6-grunt-contrib-clean-0-6-0 grunt-contrib-clean@0.6.0
222 silly lockFile 0a668ef6-grunt-contrib-clean-0-6-0 grunt-contrib-clean@0.6.0
223 silly lockFile a201c56e-istanbul-0-3-4 istanbul@^0.3.4
224 silly lockFile a201c56e-istanbul-0-3-4 istanbul@^0.3.4
225 error Error: CERT_UNTRUSTED
225 error at SecurePair.<anonymous> (tls.js:1370:32)
225 error at SecurePair.EventEmitter.emit (events.js:92:17)
225 error at SecurePair.maybeInitFinished (tls.js:982:10)
225 error at CleartextStream.read [as _read] (tls.js:469:13)
225 error at CleartextStream.Readable.read (_stream_readable.js:320:10)
225 error at EncryptedStream.write [as _write] (tls.js:366:25)
225 error at doWrite (_stream_writable.js:223:10)
225 error at writeOrBuffer (_stream_writable.js:213:5)
225 error at EncryptedStream.Writable.write (_stream_writable.js:180:11)
225 error at write (_stream_readable.js:583:24)
225 error at flow (_stream_readable.js:592:7)
225 error at Socket.pipeOnReadable (_stream_readable.js:624:5)
226 error If you need help, you may report this log at:
226 error http://github.com/isaacs/npm/issues
226 error or email it to:
226 error <npm-@googlegroups.com>
227 error System Linux 3.19.0-25-generic
228 error command "/usr/bin/nodejs" "/usr/bin/npm" "install"
229 error cwd /home/turbine-vm-appbudiler/Workspace/cordova-js
230 error node -v v0.10.25
231 error npm -v 1.3.10
232 verbose exit [ 1, true ]

有知道解决方案的吗?


这是因为ssl验证问题,使用下面的命令取消ssl验证即可解决:

npm config set strict-ssl false


换http连接,https连接由于证书的问题会报错

【热门文章】
【热门文章】