Home > OS >  npx create-react-app gives error need to install the following packages: create-react-app
npx create-react-app gives error need to install the following packages: create-react-app

Time:04-25

I'm trying to install react to create a project in vs code. When I try doing this using npx create-react-app frontend I get:

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

Which then gives me an error saying that:

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

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/

I entered npm uninstall -g create-react-app and followed the latest instructions , but the the latest instructions say to use npx create-react-app, and when I try it again I keep getting the exact same issue. Does anyone know why this is happening or how to fix this?

CodePudding user response:

You need to uninstall the global installation first which you did but in my case I had to clear the cache too.

try this:

npx clear-npx-cache
  • Related