【发布时间】:2022-06-10 20:05:35
【问题描述】:
我在代理网络中,正在尝试使用 npx expo-cli init 启动新的 react native 项目,但我收到了以下错误消息:
Something went wrong while downloading and extracting the template.
request to https://registry.npmjs.org/expo-template-blank/-/expo-template-blank-45.0.3.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
我已经在 npm 中设置了我的代理网络,并使用以下语法删除了 strict-ssl 配置:
npm config set strict-ssl false
npm config set registry http://registry.npmjs.org/
npm config set proxy http://(myProxyAddress):(myPort)
npm config set https-proxy http://(myProxyAddress):(myPort)
我可以上网冲浪,通过 npm start 运行 expo,但我无法启动新项目。
我也无法通过代理网络 ping 8.8.8.8,但如果使用非代理网络则可以。
如果我没有使用代理网络,我可以通过 npx expo-cli init 启动一个新项目
我错过了什么?任何回应将不胜感激!
【问题讨论】:
标签: node.js git react-native npm proxy