npm install 出错

 

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

 

posted @ 2018-01-27 12:09  web男  阅读(174)  评论(0编辑  收藏  举报