首页 > 其他 > 详细

npm 报错unable to verify the first certificate

时间:2018-04-17 13:28:10      阅读:198      评论:0      收藏:0      [点我收藏+]

npm总是报错:unable to verify the first certificate

原创 2017年09月30日 11:06:10
https://blog.csdn.net/nicexibeidage/article/details/78140692?locationNum=2&fps=1

今天npm install总是报错:unable to verify the first certificate(无法验证第一证书),查了一下发现

As of February 27, 2014, npm no longer supports its self-signed certificates.

2014年2月27日,npm不再支持自签名证书。

因为npm install走的是https协议,需要通过数字证书来保证的

解决方法1:

取消ssl验证:npm config set strict-ssl false

如果还没成功,则将npm源更换为国内镜像:
npm config set registry http://registry.cnpmjs.org/
npm config set registry http://registry.npm.taobao.org/

解决方法2:

升级:npm install npm -g --ca=null
或者 npm config set ca=""

推荐使用方法1

npm 报错unable to verify the first certificate

原文:https://www.cnblogs.com/dianzan/p/8863967.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!