本文最后更新于:2024年5月7日 下午
安装 node.js 后可能出现 npm 安装包时报错
unable to verify the first certificate
的问题,本文记录解决方案。
错误复现
- npm 命令安装包时失败报错
1 |
|
问题原因
1 |
|
2014年2月27日,npm不再支持自签名证书。因为npm install走的是https协议,需要通过数字证书来保证的。
解决方案
- 暂时取消ssl验证
1 |
|
- 随后可以正常安装包,之后可以再开启
1 |
|
- 如果还没有成功,npm源更换为国内镜像:
1 |
|
参考资料
- https://blog.csdn.net/last_sho/article/details/113521910
- https://blog.csdn.net/nicexibeidage/article/details/78140692
文章链接:
https://www.zywvvd.com/notes/coding/node-js/nodejs-install-error/nodejs-install-error/
“觉得不错的话,给点打赏吧 ୧(๑•̀⌄•́๑)૭”
微信支付
支付宝支付
Node.js npm 安装包 unable to verify the first certificate 错误解决方案
https://www.zywvvd.com/notes/coding/node-js/nodejs-install-error/nodejs-install-error/