0
votes

when I was trying to run create-react-app using the command npx create-react-app app I got the following Message

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

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 then tried to uninstall create-react-app globally using npm uninstall -g create-react-app and rerun npx command again i still get the same message that I should uninstall create-react-app globally even so the only module that is installed globally is npm on my machine

2

2 Answers

1
votes

You first need to uninstall the globally installed create-react-app and then, invalidate the cache.

Command for the same: npm uninstall -g create-react-app && npm cache clean -f

Now, you may continue with creating the application again using: npx create-react-app application-name.

This question is similar to this one.

0
votes

Try npm cache clean –-force command after uninstalling create-react-app globally.