React Native错误创建新项目 ‘复制模板’

huangapple go评论51阅读模式
英文:

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

huangapple
  • 本文由 发表于 2023年2月8日 21:08:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/75386267.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定