2

I have both Yarn and NPM installed but whenever I try to create-react-app it automatically uses Yarn.

I tried to run create-react-app app --use-npm but then it created it using an older version of node and NPM.

I then tried updating the node and NPM version and ran npm -v which showed the latest version but again after running create-react-app app --use-npm it got created with older versions devoid of latest features of the create-react-app.

I want to use NPM and create the react app using all the latest versions of node and NPM without removing Yarn from my system. Where I am going wrong and what are the possible solutions?

RobC
  • 22,977
  • 20
  • 73
  • 80

2 Answers2

1

When you want to use npm, go to the project folder:

  1. Delete yarn.lock
  2. Delete node_modules
  3. Run npm install

It will use the latest npm installed on yours system.

Dennis Vash
  • 50,196
  • 9
  • 100
  • 118
0

Try npx create-react-app my-app

Milos
  • 569
  • 3
  • 8
  • 21