npm 遇到的坑

在脚手架方式搭建react项目时,输入命令:npm install -g create-react-app,出现错误:

UNABLE_TO_VERIFY_LEAF_SIGNATURE
UNABLE_TO_VERIFY_LEAF_SIGNATURE
unable to verify the first certificate(无法验证第一证书)


然后各种报错。

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

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

原文地址:https://www.cnblogs.com/yuanyuanya/p/10144005.html