reactnativecn / react-native-website

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

npx @react-native-community/cli@latest init 的时候TypeError: fetch failed #902

Open zhangweiyuan opened 2 weeks ago

zhangweiyuan commented 2 weeks ago

谁能帮忙看一下是什么原因啊,一直显示这个,vpn也开了。 zhangweiyuan@zhangweiyuandeMacBook-Air mhy-app-user % npx @react-native-community/cli@latest init mhyproject --verbose

debug We couldn't find a package.json in your project. Are you sure you are running it inside a React Native project? debug Failed to load configuration of your project. Only a subset of commands will be available. debug Mapped: latest -> 0.76.1 debug [template]: is '0.76.1 (0.76.1)' < '0.75.0' = no, look for template in @react-native-community/template error fetch failed. TypeError: fetch failed at node:internal/deps/undici/undici:13392:13 at async getTemplateVersion (/Users/zhangweiyuan/.npm/_npx/2788f5fbd47acb89/node_modules/@react-native-community/cli/build/tools/npm.js:117:16) at async createTemplateUri (/Users/zhangweiyuan/.npm/_npx/2788f5fbd47acb89/node_modules/@react-native-community/cli/build/commands/init/version.js:53:29) at async createProject (/Users/zhangweiyuan/.npm/_npx/2788f5fbd47acb89/node_modules/@react-native-community/cli/build/commands/init/init.js:338:23) at async Object.initialize [as func] (/Users/zhangweiyuan/.npm/_npx/2788f5fbd47acb89/node_modules/@react-native-community/cli/build/commands/init/init.js:418:7) at async Command.handleAction (/Users/zhangweiyuan/.npm/_npx/2788f5fbd47acb89/node_modules/@react-native-community/cli/build/index.js:116:9) zhangweiyuan@zhangweiyuandeMacBook-Air mhy-app-user %

848398288 commented 2 weeks ago

一样 没搞懂是什么问题 我还以为是node版本太高,我还去降了个node到18也是不行

1
HuXin957 commented 2 weeks ago

一样 没搞懂是什么问题 我还以为是node版本太高,我还去降了个node到18也是不行 1

please retry!