创建新项目时发生React Native错误“正在复制模板”

9wbgstp7  于 2023-02-16  发布在  React
关注(0)|答案(1)|浏览(172)

当我尝试在macos Ventura 13.2上创建新React原生项目时

✔ 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.

我已尝试删除并重新安装以下软件
sudo npm uninstall -g react-native-cli @react-native-community/cli
诺伊斯

fiei3ece

fiei3ece1#

已通过将系统更新至13.2.1修复该问题。然后执行

sudo npm uninstall -g react-native-cli @react-native-community/cli

npx react-native init AwesomeProject --npm

相关问题