【问题标题】:node package manager install error with ExpressExpress的节点包管理器安装错误
【发布时间】:2013-05-08 00:17:23
【问题描述】:

我正在尝试使用节点包管理器安装 express,但出现以下错误。这是在以管理员身份运行 cmd 的 Windows 7 x64 上。有什么帮助吗?

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

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

【问题讨论】:

标签: windows node.js express npm


【解决方案1】:

您会注意到,如果您连接到 https://registry.npmjs.org/,Chrome 给您一个 SSL 错误,因为 registry.npmjs.org 正在提供自签名 SSL 证书。 s> registry.npmjs.org 现在使用正确的 CA 签名证书。

有两种可能:

  • 你的 npm 配置搞砸了。删除所有与 npm 相关的内容并重新安装。
  • 如果您所在的环境具有拦截 HTTPS 代理,它可能会破坏 npm。与您的网络管理员联系。

【讨论】:

  • 我相信这是正确的,最新版本的网络部分在家里立即工作......我明天在工作时会进一步研究它,看看网络管理员是否看到相同失败。
  • 我已经升级了我的节点和 npm。我似乎有4个证书。但我仍然得到错误。还有什么想法吗?
  • @AlexB:我的 npm 现在也有 4 个证书,而且我注意到 registry.npmjs.org 现在使用正确的 CA 签名证书,默认情况下应该验证。由于 npm 不再使用自签名证书,因此您很可能位于具有拦截 HTTPS 代理的网络上。与您的网络管理员联系。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-02-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多