【问题标题】:Expo cannot update npm packages due to SELF_SIGNED_CERT_IN_CHAIN由于 SELF_SIGNED_CERT_IN_CHAIN,Expo 无法更新 npm 包
【发布时间】:2019-03-12 17:40:42
【问题描述】:

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.js react-native npm ssl-certificate expo


    【解决方案1】:

    试试这个。 唯一的解决办法

    npm set strict-ssl false
    

    【讨论】:

      猜你喜欢
      • 2016-04-02
      • 1970-01-01
      • 2021-10-24
      • 1970-01-01
      • 2012-09-01
      • 2018-06-27
      • 2014-04-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多