【问题标题】:npm install --save-dev gulp : SELF_SIGNED_CERT_IN_CHAINnpm install --save-dev gulp : SELF_SIGNED_CERT_IN_CHAIN
【发布时间】:2017-03-18 20:52:56
【问题描述】:

我正在尝试学习 node、npm 和 gulp,但都遇到了这个错误。

$ npm install --save-dev gulp
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" "--save-dev" "gulp"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
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!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\davidb\desktop\testproject\npm-debug.log

有谁知道如何解决这个问题?我使用 gitbash 而不是节点,因为在我的节点中我什至不能做 node-v 我必须使用 process.version 来获取版本。非常感谢您的帮助!我一直在使用http://blog.npmjs.org/post/78165272245/more-help-with-selfsignedcertinchain-and-npm 尝试解决此问题,但没有任何效果。

也试过了:

npm config set ca ""

and 

npm install npm -g --ca=""

两者都不起作用,我仍然收到错误 npm ERR!代码 SELF_SIGNED_CERT_IN_CHAIN

【问题讨论】:

    标签: node.js npm gulp npm-install


    【解决方案1】:

    也许 Windows 的 SSL 拦截代理正在弄乱你的 npm。

    结帐 Github 问题答案 - https://github.com/npm/npm/issues/7519#issuecomment-97522305

    其他选项:

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

    但这会降低您的安全性。

    【讨论】:

      猜你喜欢
      • 2016-08-18
      • 2021-11-11
      • 2016-01-08
      • 2020-10-22
      • 1970-01-01
      • 1970-01-01
      • 2020-04-13
      • 2013-10-13
      相关资源
      最近更新 更多