14

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

borja gómez
  • 1,001
  • 8
  • 19
  • What version of node do you have running? Could you please run `nvm list`? All the versions install should displayed and the one in use should be annotated. – sjgallen Dec 20 '21 at 06:43
  • Following the first answer to this question might help you: https://stackoverflow.com/questions/61362017/removing-old-versions-of-create-react-app – sjgallen Dec 20 '21 at 06:53
  • I have added the node version (16.4.0) and I tried to follow the thread https://stackoverflow.com/questions/61362017/removing-old-versions-of-create-react-app but it did not work – borja gómez Dec 20 '21 at 07:24
  • [Here](https://github.com/facebook/create-react-app/issues/11816) is a related issue – liuliang Dec 30 '21 at 08:39

2 Answers2

46

This caught me too. You need to run

npx clear-npx-cache
James L
  • 16,456
  • 10
  • 53
  • 70
0

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.

Alicia Sykes
  • 5,997
  • 7
  • 36
  • 64