英文:
React Native Error create new project ' Copying template '
问题
当我尝试在macOS Ventura 13.2上创建新的React Native项目时:
✔ 下载模板
✖ 复制模板
错误 Error: 无法找到位于 "react-native" 模板内的 "/var/folders/mn/m8xhgjss2cj0jf5svmxg_2vm0000gn/T/rncli-init-template-VUPUIq/node_modules/react-native/template.config.js" 文件。请确保模板有效。更多信息请参阅:https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template。
错误: Error: 无法找到位于 "react-native" 模板内的 "/var/folders/mn/m8xhgjss2cj0jf5svmxg_2vm0000gn/T/rncli-init-template-VUPUIq/node_modules/react-native/template.config.js" 文件。请确保模板有效。更多信息请参阅:https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template
at createFromTemplate (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:129:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.initialize [as func] (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:181:3)
at async Command.handleAction (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js:106:9)
信息 使用 --verbose 标志运行CLI以获取更多详细信息。
我已尝试移除并重新安装以下内容:
sudo npm uninstall -g react-native-cli @react-native-community/cli
Node.js
英文:
when I'm try create new react native project
on macos Ventura 13.2
✔ Downloading template
✖ Copying template
error Error: Couldn't find the "/var/folders/mn/m8xhgjss2cj0jf5svmxg_2vm0000gn/T/rncli-init-template-VUPUIq/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/mn/m8xhgjss2cj0jf5svmxg_2vm0000gn/T/rncli-init-template-VUPUIq/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/imac/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:129:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.initialize [as func] (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/commands/init/init.js:181:3)
at async Command.handleAction (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/@react-native-community/cli/build/index.js:106:9)
info Run CLI with --verbose flag for more details.
I have tried removing and reinstalling the following
sudo npm uninstall -g react-native-cli @react-native-community/cli
Nodejs
答案1
得分: 2
问题已通过将系统更新到13.2.1来解决
然后执行
sudo npm uninstall -g react-native-cli @react-native-community/cli
npx react-native init AwesomeProject --npm
英文:
The problem has been fixed by updating the system to 13.2.1
Then execute
sudo npm uninstall -g react-native-cli @react-native-community/cli
npx react-native init AwesomeProject --npm
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论