reactnativecn / react-native-website

React Native 中文网
https://reactnative.cn
MIT License
219 stars 328 forks source link

window10系统创建项目下载template报错 #882

Open lw20001210 opened 1 month ago

lw20001210 commented 1 month ago

请按以下格式提供问题的相关信息。

window10系统创建项目下载template报错

PS D:\newStart\ReactNative> npx @react-native-community/cli@latest init first

           ######                ######
         ###     ####        ####     ###
        ##          ###    ###          ##
        ##             ####             ##
        ##             ####             ##
        ##           ##    ##           ##
        ##         ###      ###         ##
         ##  ########################  ##
      ######    ###            ###    ######
  ###     ##    ##              ##    ##     ###      

  ###     ##    ##              ##    ##     ###      
      ######    ###            ###    ######
         ##  ########################  ##
        ##           ##    ##           ##
        ##             ####             ##
        ##             ####             ##
        ##          ###    ###          ##
         ###     ####        ####     ###
           ######                ######

          Welcome to React Native 0.75.3!
          Welcome to React Native 0.75.3!
             Learn once, write anywhere

             Learn once, write anywhere

⠏ Downloading template

error An unexpected error occurred: Command failed with exit code 1: yarn add @react-native-community/template@0.75.5 ⠏ Downloading template

error An unexpected error occurred: Command failed with exit code 1: yarn add @react-native-community/template@0.75.5 warning ........\package.json: No license field warning ........\package.json: No license field error Error: https://registry.npmmirror.com/@react-native-community%2ftemplate: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 10809 error Error: https://registry.npmmirror.com/@react-native-community%2ftemplate: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 10809 at ClientRequest.onError (C:\Users\Lw\AppData\Roaming\nvm\v18.16.1\node_modules\yarn\lib\cli.js:152360:17) at ClientRequest.onError (C:\Users\Lw\AppData\Roaming\nvm\v18.16.1\node_modules\yarn\lib\cli.js:152360:17) at Object.onceWrapper (node:events:628:26) at Object.onceWrapper (node:events:628:26) at ClientRequest.emit (node:events:513:28) at ClientRequest.emit (node:events:513:28) at Socket.socketErrorListener (node:_http_client:502:9) at Socket.socketErrorListener (node:_http_client:502:9) at Socket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) yarn add v1.22.21 info No lockfile found. [1/4] Resolving packages... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... info There appears to be trouble with your network connection. Retrying... info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command..

请描述完整的环境/版本信息

屏幕截图 2024-09-24 210943 屏幕截图 2024-09-24 211045

sunnylqm commented 1 month ago

tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 10809 这应该是你的代理问题

lw20001210 commented 1 month ago

tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 10809 这应该是你的代理问题

最后我是在https://reactnative.dev/这个官网用它的创建命令成功的,官方中文文档https://www.react-native.cn/的创建命令就一直报上面那个错,关代理或者换代理都报错

sunnylqm commented 1 month ago

它的创建命令是指什么?expo?expo是无法直接安装第三方原生模块的

lw20001210 commented 1 month ago

它的创建命令是指什么?expo?expo是无法直接安装第三方原生模块的

npx create-expo-app@latest

sunnylqm commented 1 month ago

expo不涉及原生环境,创建比较简单,但是是预编译的环境,预编译的不是国内常用的模块,国内常用的模块又不能直接安装,所以在中文网上不是首选

ry-krystal commented 1 month ago

加我,帮你解决问题,微信号Krystaless