命令
npx react-native@latest init AwesomeProject
输出
✔ Downloading template
✖ Copying template
error Error: Couldn't find the "/var/folders/8x/y10dxy554tzb5d5d2tv_rffh0000gn/T/rncli-init-template-c131XZ/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid. Read more: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template.
Error: Error: Couldn't find the "/var/folders/8x/y10dxy554tzb5d5d2tv_rffh0000gn/T/rncli-init-template-c131XZ/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid. Read more: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template
at createFromTemplate (/Users/rmunoz/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/commands/init/init.js:131:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.initialize [as func] (/Users/rmunoz/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/commands/init/init.js:184:3)
at async 命令.handleAction (/Users/rmunoz/.npm/_npx/dea611a43221eddd/node_modules/@react-native-community/cli/build/index.js:106:9)
info Run CLI with --verbose flag for more details.
我判断了/var/目录,发现/T/rncli-init-template-c131XZ/node_modules/react-native/template.config.js不存在.我试着在网上寻找自己制作的模板,但我找不到它,我真的不知道go 哪里找.
我使用了GitHub链接,但我显然不想创建自定义模板.
我确实按照文档安装了Xcode CLI工具和Ruby 2.7.6的正确版本