由于 SELF_SIGNED_CERT_IN_CHAIN,Expo 无法更新 npm 包 [英] Expo cannot update npm packages due to SELF_SIGNED_CERT_IN_CHAIN

查看:16
本文介绍了由于 SELF_SIGNED_CERT_IN_CHAIN,Expo 无法更新 npm 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Expo for React Native requires the dependency for react-native to be formatted like this:

"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 更新节点包时,我收到以下错误

When I use npm install to update node packages, I get the following error

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 而不会出现任何自签名证书问题.

This only happens in my expo projects. I can use npm install without any self signed certificate issues in other node projects.

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

How can I remove the self signed certificate? Otherwise how can I solve this error without disabling SSL completely?

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

I have already tried npm config set ca "" as well as upgrading npm to the latest version.

推荐答案

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

try this. the only solution

npm set strict-ssl false

这篇关于由于 SELF_SIGNED_CERT_IN_CHAIN,Expo 无法更新 npm 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆