解决npm install过程中报错:unable to verify the first certificate

今天使用npm安装开发包时遇到“unable to verify the first certificate”(无法验证第一证书)这个问题

 

原因:2014年2月27日,npm不再支持自签名证书。因为npm install走的是https协议,需要通过数字证书来保证的

 

网上找到的解决方法是:

1.取消ssl验证:npm config set strict-ssl false(我在这步就解决了问题)

2.如果第一步不行,将npm源更换为国内镜像:

   npm config set registry http://registry.cnpmjs.org/
   npm config set registry http://registry.npm.taobao.org/

posted @ 2017-09-14 09:22  波兰火箭名宿  阅读(4149)  评论(0编辑  收藏  举报