【问题标题】:npx expo-cli install error, reason: getaddrinfo ENOTFOUNDnpx expo-cli 安装错误,原因:getaddrinfo ENOTFOUND
【发布时间】: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


    【解决方案1】:

    npx expo-cli init title 目前已被弃用。相反,您可以使用此代码为 react native 启动一个新项目:

    npx expo-cli init projectTitle --npm
    

    【讨论】:

      猜你喜欢
      • 2022-06-23
      • 2019-10-28
      • 1970-01-01
      • 2017-10-16
      • 2018-03-03
      • 2014-10-20
      • 2018-05-24
      • 2016-04-20
      • 2018-01-31
      相关资源
      最近更新 更多