How to make create-react-app use npm instead of yarn?
You can either
1) Remove yarn.lock
, and running npm i
,
or
2) Run create-react-app app --use-npm
- Install create-react-app
npm i -g create-react-app --use-npm
- Go to desired path using cd command
- Add --use-npm
create-react-app my-app-name --use-npm
This command will create a folder with the name that you mentioned inside your current path . This folder consists all necessary configuration files needed for a starter code for react application
1 ⇢ If you have installed create-react-app
then use:
create-react-app --use-npm
2 ⇢ If you are using npx
command then use:
npx create-react-app --use-npm
3 ⇢ For existing yarn
app, remove the yarn.lock
file and run:
npm i
or
npm install