nodejs“npm ERR! 代码SELF_SIGNED_CERT_IN_CHAIN“

我是nodejs和npm的新手。 我正在尝试安装log4js,这是安装的命令:

npm install log4js 

我从Windows命令行运行这个,并在一段时间的标记旋转后,我得到以下错误:

 npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "log4js" npm ERR! node v0.12.0 npm ERR! npm v2.5.1 npm ERR! code SELF_SIGNED_CERT_IN_CHAIN npm ERR! self signed certificate in certificate chain npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <http://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! C:\srv\npm-debug.log 

我试着做npm config set ca=""就像这里build议的一样: http : //blog.npmjs.org/post/78085451721/npms-self-signed-certificate-is-no-more但是我仍然得到这个错误。

我如何解决这个问题并安装NPM?

同样的事情,但我不得不提到,我只用了

npm设置strict-ssl为false

它解决了我的问题。

我也是npm新​​手。 除了在你的链接中提到的命令,我尝试了以下,它解决了我的问题:

  • npm设置strict-ssl为false
  • 禁用McAfee暂时

参考: Azure上的Npm SELF_SIGNED_CERT_IN_CHAIN

正如上面的Akshay Vijay Jain所提到的,

npm config set strict-ssl false

在安装最新版本之前closuresSSL

然后安装最新版本

npm install -g npm @ latest

安装成功!

请参阅添加的屏幕截图以便清晰。

就我而言,我已经安装了Fiddler,它有一个自签名证书,使npm安装变得疯狂。

请参阅此处如何删除自签名Fiddler证书如何删除Fiddler安装的根CA证书