节点包管理器安装误差与快递(node package manager install error w

2019-10-18 03:51发布

我试图使用节点包管理器安装快递和我得到下面的错误。 这是上运行CMD管理员的Windows 7 64位系统。 任何援助?

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\>npm install express -g
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/express
npm ERR! Error: SELF_SIGNED_CERT_IN_CHAIN
npm ERR!     at SecurePair.<anonymous> (tls.js:1283:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:896:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:430:15)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:304:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:344:25)
npm ERR!     at doWrite (_stream_writable.js:211:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:201:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:172:11)
npm ERR!     at write (_stream_readable.js:557:24)
npm ERR! If you need help, 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 Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "express" "-g"
npm ERR! cwd C:\
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\npm-debug.log
npm ERR! not ok code 0

我可以连接到http://registry.npmjs.org/express在Chrome返回JSON

Answer 1:

如果您连接到你会发现//registry.npmjs.org/是:http 小号 ,Chrome 因为registry.npmjs.org是服务了一个自签名的SSL证书给你一个SSL错误。 registry.npmjs.org现在使用适当的CA签发的证书。

有两种可能性:

  • 您的NPM配置被搞砸了。 删除一切NPM-相关并重新安装。
  • 如果你的环境是有拦截HTTPS代理,则很可能打破NPM。 请与您的网络管理员。


文章来源: node package manager install error with Express