最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error: couldn't find template.config.js when creating a React Native project version 0.59.9 - Stack Overflo

programmeradmin5浏览0评论

When I try to create a react native project version 0.59.9 I get the following error

error Error: Couldn't find the "/var/folders/zc/h93bvpb573q24_5ynvgkn1wc0000gn/T/rncli-init-template-0YT6FZ/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid.

How can I resolve this issue?

The mand I used is npx react-native init Awesome --version 0.59.9

How can I resolve this issue, and what could be the cause of it?

Here's a screenshot of the terminal as well

Thanks

When I try to create a react native project version 0.59.9 I get the following error

error Error: Couldn't find the "/var/folders/zc/h93bvpb573q24_5ynvgkn1wc0000gn/T/rncli-init-template-0YT6FZ/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid.

How can I resolve this issue?

The mand I used is npx react-native init Awesome --version 0.59.9

How can I resolve this issue, and what could be the cause of it?

Here's a screenshot of the terminal as well

Thanks

Share Improve this question asked Jul 28, 2020 at 9:18 Jihad NajiJihad Naji 3111 gold badge4 silver badges13 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 17
  1. Be sure uninstall global react-native/cli as described react-native tutorials

  2. Try to use --npm end of init mand if you had yarn and npm both.

    npx react-native init MyApp --npm

Note: If you have both yarn and npm installed on your machine, React Native CLI will always try to use yarn, so even if you use npx utility, only react-native executable will be installed using npm and the rest of the work will be delegated to yarn. You can force usage of npm adding --npm flag to the mand.

You can try to use a template from another version

npx react-native init Awesome --version 0.59.9 [email protected]

This Worked For me npx react-native@latest init ProjectName --pm npm

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论