Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 command 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

enter image description here

Thanks

like image 436
Jihad Naji Avatar asked Oct 26 '25 02:10

Jihad Naji


2 Answers

  1. Be sure uninstall global react-native/cli as described react-native tutorials

  2. Try to use --npm end of init command 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 command.

like image 185
Mustafa Ak Avatar answered Oct 28 '25 15:10

Mustafa Ak


You can try to use a template from another version

npx react-native init Awesome --version 0.59.9 [email protected]
like image 26
BloodyMonkey Avatar answered Oct 28 '25 16:10

BloodyMonkey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!