cli icon indicating copy to clipboard operation
cli copied to clipboard

Couldn't find template.config.js file inside "react-native" template. Please make sure the template is valid

Open mhmdalii opened this issue 2 years ago • 2 comments

Ask your Question

Hi , i face this isusse once i get new macbook m1 and try all solution and doen't get any one to solve this , can any one help in this ? Screen Shot 2022-07-06 at 2 46 36 PM

mhmdalii avatar Jul 06 '22 12:07 mhmdalii

+1

ReAlign avatar Jul 14 '22 19:07 ReAlign

add --npm at the end of your command

icefee avatar Aug 10 '22 02:08 icefee

@icefee's solution did the trick for me.

StebanDev avatar Nov 07 '22 02:11 StebanDev

@icefee thanks

mrlexz avatar Jan 16 '23 15:01 mrlexz

add --npm at the end of your command

The reason for adding --npm:

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.

Reference: https://github.com/react-native-community/cli/blob/main/docs/init.md#using-npx-utility

mrtoorich avatar Feb 06 '23 09:02 mrtoorich

npx react-native init YourAwesomeProject --npm _____________________ above command works without uninstall yarn____________________________________ uninstall yarn globally npm uninstall -g yarn

Murtala-1 avatar Apr 07 '23 09:04 Murtala-1

Definitely, Yarn is the problem.

npx react-native init YourAwesomeProject --npm

That worked for me

jesualdo13 avatar Apr 26 '23 20:04 jesualdo13

Closing the issue for now since we seem to have found a workaround for now (while we still work on proper solution 🙂 )

adamTrz avatar May 11 '23 08:05 adamTrz

add --npm at the end of your command

thanks

amilog avatar May 25 '23 05:05 amilog

For those who don't want to uninstall yarn globally:

If you have followed the docs here https://yarnpkg.com/getting-started/install and used corepack, just run the following command:

corepack prepare [email protected] --activate

atlj avatar Jun 23 '23 19:06 atlj

Just run:

yarn dlx react-native init mobile --npm

--npm will specify node_linker inside the yarnrc.yml file.

It is for yarn 2+

alyiev avatar Jul 23 '23 17:07 alyiev

Closing the issue for now since we seem to have found a workaround for now (while we still work on proper solution 🙂 )

Is there a proper soulation now?

olawalejuwonm avatar Mar 07 '24 09:03 olawalejuwonm

hey @olawalejuwonm, you need to use Yarn with nodeLinker: node-modules, make sure that you're not using PnP.

szymonrybczak avatar Mar 07 '24 10:03 szymonrybczak