Expo cannot update npm packages due to SELF_SIGNED_CERT_IN_CHAIN

Deadly 提交于 2020-02-04 05:18:09

问题


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"
}

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

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

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

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


回答1:


try this. the only solution

npm set strict-ssl false


来源:https://stackoverflow.com/questions/52695693/expo-cannot-update-npm-packages-due-to-self-signed-cert-in-chain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!