今天npm install老是報錯:unable to verify the first certificate(沒法驗證第一證書),查了一下發現npm
As of February 27, 2014, npm no longer supports its self-signed certificates.
2014年2月27日,npm再也不支持自簽名證書。code
由於npm install走的是https協議,須要經過數字證書來保證的ssl
取消ssl驗證:npm config set strict-ssl falseget
若是還沒成功,則將npm源更換爲國內鏡像:
npm config set registry http://registry.cnpmjs.org/
npm config set registry http://registry.npm.taobao.org/it
升級:npm install npm -g --ca=null
或者 npm config set ca=""cnpm
推薦使用方法1方法