Error while creating new React app ("You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0)")

Issue

I am getting this create React app error again and again even after doing the uninstall part.

npm uninstall -g create-react-app

up to date, audited 1 package in 570ms

found 0 vulnerabilities

npx create-react-app test-app

Need to install the following packages: create-react-app Ok to
proceed? (y) 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/

C:\>npm --version
8.3.0
C:\>node --version
v16.13.0

How can I fix this?

Solution

Try running npx clear-npx-cache to clear your npx cache and then running the npx create-react-app your-app command.

Also have a look at this answer on clearing the cache.

Additionally, it might be worth trying to force the latest version with:

npx create-react-app@latest my-app --use-npm

Answered By – adrian

Answer Checked By – Mary Flores (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.