node.js - NPM self_signed_cert_in_chain

标签 node.js npm visual-studio-2015

我在正确安装 NPM 时遇到问题。我已尝试逐步阅读此处有关堆栈溢出的几个帖子的说明,特别是来自此线程: SELF_SIGNED_CERT_IN_CHAIN error while using npm install

我还尝试过浏览 NPM 网站上的文档: https://blog.npmjs.org/post/78165272245/more-help-with-self-signed-cert-in-chain-and-npm.html

我每次尝试安装时仍然收到错误消息。请指教。

最佳答案

如果您使用公司代理(例如使用 Blue Coat ),您应该使用 http 而不是 https 作为存储库地址,例如

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

见:Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN while using npm .


您还可以将失败的 self 证书导入您的系统并标记为受信任,或在安装软件包时临时禁用 SSL 验证(快速但不推荐的方法):

npm config set strict-ssl false

见:Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN while using npm .


推荐的方法(而且更痛苦)只是指向正确的证书文件,例如

npm config set cafile "<path to your certificate file>"

见:How to fix SSL certificate error when running Npm on Windows? .

关于node.js - NPM self_signed_cert_in_chain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34498736/

相关文章:

node.js - 类型错误 : Cannot Read Property 'imageName' of undefined

node.js - 查看依赖包 X 的本地 NPM 包

windows - 已安装 VS 2015 后如何安装 WinDbg?

android - Visual Studio 2015 Cordova - 未签名 APK

node.js - 如何使用 .pfx 类型的证书修复 nodejs 中缺少的中间/链证书

node.js - 使用 npm 安装的数据包不会走向全局

Node.js - Mongoose 无法访问包含包中的数据库

javascript - Windows 7 专业版上的 "Fatal error: Unable to find local grunt."

c++ - 没有 WinMain 的 winapi 入口点

node.js - 在谷歌云上运行 node.js,但使用 docker 运行时出错