Can't use npx create-react-app "no longer support global installation of Create React App"

Viewed 2891

I can't create a new application using the create-react-app. The command I am using is npx create-react-app appname --template typescript.

The error I get is:

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

I removed the global package with npm uninstall -g create-react-app. I then checked the packaged is not installed globally by

  1. Running npm list -g
  2. Checking the folder C:\Users\my-user\AppData\roaming\npm

But create-react-app keeps saying I have globally installed "create-react-app 4.0.3".

After all I did clean cache with npm cache clean --force and reboot computer but with the same result.

I am runnig on windows 10, npm 7.18.1 and node 16.4.0

What am I missing?

Thanks in advance

2 Answers

This caught me too. You need to run

npx clear-npx-cache

In my instance, I had an older version of create-react-app installed globally with yarn, and simply removing it fixed the issue.

yarn global remove create-react-app

Or, for NPM

npm uninstall -g create-react-app

I was then able to run npx create-react-app my-app without issue.

Related