Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zhangweiyuan opened this issue Nov 5, 2024 · 1 comment

Comments

@zhangweiyuan
Copy link

谁能帮忙看一下是什么原因啊,一直显示这个,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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants