2

I'm working on an Ubuntu 20.04 machine.

If I run npx create-react-app myapp the system responds with an error:

Need to install the following packages:
  create-react-app
Ok to proceed? (y) 

You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/

then, when I run npm uninstall -g create-react-app the the uninstall do nothing:

xxx@xxx:/prj$ npm uninstall -g create-react-app

up to date, audited 1 package in 307ms

found 0 vulnerabilities

So, I cannot create a new react application using npx.

Any suggestion?

Paolo Di Pietro
  • 517
  • 3
  • 17
  • https://stackoverflow.com/questions/64963796/create-react-app-is-not-working-since-version-4-0-1 – HDM91 Dec 22 '21 at 09:11
  • You’ll need to have Node >= 14 on your local development machine. Do you have it?. $ node --version – Robson Sampaio Dec 22 '21 at 09:11
  • Does this answer your question? [create-react-app is not working since version 4.0.1](https://stackoverflow.com/questions/64963796/create-react-app-is-not-working-since-version-4-0-1) – HDM91 Dec 22 '21 at 09:11
  • The running answer I found on https://stackoverflow.com/questions/70352503/npx-create-react-app-prompting-to-globally-uninstall-non-existent-create-react-a is `npx clear-npx-cache` – Paolo Di Pietro Dec 22 '21 at 09:14

1 Answers1

7

I had this issue and this worked for me, after npm uninstall -g create-react-app :


  1. npm cache clean --force
  2. npm cache verify
  3. npx clear-npx-cache to clear your npx cache.
  4. npx create-react-app your-app or npx create-react-app@latest my-app --use-npm
MarioG8
  • 5,122
  • 4
  • 13
  • 29