cli
cli copied to clipboard
Couldn't find template.config.js file inside "react-native" template. Please make sure the template is valid
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 ?

+1
add --npm at the end of your command
@icefee's solution did the trick for me.
@icefee thanks
add --npm at the end of your command
The reason for adding --npm:
If you have both
yarnandnpminstalled on your machine, React Native CLI will always try to useyarn, so even if you usenpxutility, onlyreact-nativeexecutable will be installed usingnpmand the rest of the work will be delegated toyarn. You can force usage of npm adding--npmflag to the command.
Reference: https://github.com/react-native-community/cli/blob/main/docs/init.md#using-npx-utility
npx react-native init YourAwesomeProject --npm _____________________ above command works without uninstall yarn____________________________________ uninstall yarn globally npm uninstall -g yarn
Definitely, Yarn is the problem.
npx react-native init YourAwesomeProject --npm
That worked for me
Closing the issue for now since we seem to have found a workaround for now (while we still work on proper solution 🙂 )
add --npm at the end of your command
thanks
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
Just run:
yarn dlx react-native init mobile --npm
--npm will specify node_linker inside the yarnrc.yml file.
It is for yarn 2+
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?
hey @olawalejuwonm, you need to use Yarn with nodeLinker: node-modules, make sure that you're not using PnP.