首页 > 解决方案 > 由于 SELF_SIGNED_CERT_IN_CHAIN,Expo 无法更新 npm 包

问题描述

Expo for React Native 要求 react-native 的依赖格式如下:

"dependencies": {
    "expo": "^30.0.1",
    "react": "16.3.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz"
}

当我使用npm install更新节点包时,我收到以下错误

npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz failed, reason: self signed certificate in certificate chain

这只发生在我的世博项目中。我可以在其他节点项目中使用 npm install 而没有任何自签名证书问题。

如何删除自签名证书?否则如何在不完全禁用 SSL 的情况下解决此错误?

我已经尝试npm config set ca ""过以及将 npm 升级到最新版本。

标签: node.jsreact-nativenpmssl-certificateexpo

解决方案


尝试这个。唯一的解决方案

npm set strict-ssl false

推荐阅读