create-react-app: Create-react-app stuck on v4.0.3, cannot create a new app
Describe the bug
When attempting to use npx create-react-app <app-name>, I get the following error:
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
What I have tried to fix it:
- Run 
npm uninstall -g create-react-appto uninstall any global versions of create-react-app - Run 
npm i -g npm@latestto update npm - Run 
npm uninstall -g create-react-app && sudo npm cache clean -fto try and clean any cached information regardingcreate-react-app. 
Below is a gif showing the issue in real time.
Which terms did you search for in User Guide?
Latest release
Environment
Unfortunately, the npx create-react-app info command ends up with the same error.
I am currently on Mac v12.0.1. Please request more info if needed.
Steps to reproduce
- Attempt to run 
npx create-react-app <app-name-here> 
Expected behavior
A React app is created.
Actual behavior
create-react-app errors due to incorrect version.
About this issue
- Original URL
 - State: open
 - Created 3 years ago
 - Reactions: 23
 - Comments: 25 (1 by maintainers)
 
run
That’s the problem.
npxis NOT pulling the latest version. The workaroundnpx create-react-app@5.0.0 app-namewill let you create a react app. But if you go back to the standardnpx create-react-app my-appit goes back to this broken looping behavior where it is globally installing 4.0.3, then telling you to uninstall it… rinse… repeatso, the solution seems to be found here. Tested it on my machine, and it worked.
I didn’t know that npx had its own cache.
When creating a fresh CRA app, it prints:
Would be nice if the message included that you probably need to run
npx clear-npx-cachefor the uninstallation to properly take effect.I faced the exact same issue today - fixed it by running Step 1:
npm uninstall -g create-react-appStep 2:npm -g create-react-app@latestFollowed by: Step 3:
npx create-react-app my-applet me know if it helps.
I also ran into this issue today. I ran all above workarounds such as:
npm uninstall -g create-react-appnpx clear-npx-cachenpx create-react-app@latest my-app --use-npmnpx create-react-app@5.0.0 app-nameandnpx create-react-app@latest my-appwith no success.I am running nvm version 0.39.0, node version v16.13.1, npm version 8.3.0, and npx version 8.3.0 if that helps at all.
I did however have success with running the
yarn create react-app my-appin case any others have the same issues as me. I am running yarn version 1.22.17.Best!
When running this command, I got
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.Actually
npx create-react-app@latest my-appworks and should continue to work with a newer release…?@Runejm right, but you have to have the @latest installed globally, which you shouldn’t with npx. If you run
npm uninstall -g create-react-appit goes right back to 4.0.3 broken behavior.Agree, but if you use the method I listed above, npx does not default back to broken behavior.
So @mryechkin might be right in saying that: it is not needed to install “create-react-app” globally. however I found this to be the only way to “clear” the faulty behavior.