npm install 报错 npm ERR code UNABLETOVERIFYLEAFSIGNATURE npm ERR errno UNABLETOVERIFY_LEA 解决
# 错误
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://github.com/expo/react-native/archive/sdk-39.0.2.tar.gz failed, reason: unable to verify the first certificate
1
2
3
2
3
# 原因
无法验证第一证书,因为npm install走的是https协议,需要通过数字证书来保证的, 所以,取消ssl验证
# 解决方案
关掉strict-ssl即可, 如下:
npm config set strict-ssl false
1
用完之后恢复:
npm config set strict-ssl true
1
上次更新: 2024/01/30, 00:35:17
- 02
- Node与GLIBC_2.27不兼容解决方案08-19
- 03
- Git清空本地文件跟踪缓存08-13