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

3

3

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

Rogerrogerio answered 28/7, 2020 at 9:18 Comment(0)
C
5

You can try to use a template from another version

npx react-native init Awesome --version 0.59.9 [email protected]
Castle answered 28/7, 2020 at 9:23 Comment(0)
P
17
  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.

Prognathous answered 3/4, 2022 at 11:6 Comment(2)
--npm worked for meRudbeckia
--npm works for me on Mac M1Caston
C
5

You can try to use a template from another version

npx react-native init Awesome --version 0.59.9 [email protected]
Castle answered 28/7, 2020 at 9:23 Comment(0)
W
1

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

Wildon answered 16/8, 2024 at 19:14 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Radke

© 2022 - 2025 — McMap. All rights reserved.