Repository navigation
Create-react-app stuck on v4.0.3, cannot create a new app #11754
Description
Activity
run
npx create-react-app@5.0.0 app-nameReacted by Ryan Whelchel, Michael Taggart, Liz Nelson, Eric Zalameda, Jonathon, Julie Barwick, 潘秋惠, AlexanderMT10, Lena Lushnikova, Happy-idiOt and 15 moreReacted by Arye CaspiDang it's that simple huh. Thanks, that worked like a charm!
Is there something I can do on my end to set default behavior of
create-react-appto use the newest version? That way I don't have to specify a version any time there is an update?Sadly not that I know of
I faced the exact same issue today - fixed it by running
Step 1:npm uninstall -g create-react-app
Step 2:npm -g create-react-app@latestFollowed by:
Step 3:npx create-react-app my-applet me know if it helps.
Reacted by Andrew Langemann and anggaciptaReacted by Janhavirun
npx create-react-app@5.0.0 app-nameThank you. That worked!
Is there something I can do on my end to set default behavior of
create-react-appto use the newest version? That way I don't have to specify a version any time there is an update?Make sure you don't have
create-react-appinstalled globally, and then just runnpx create-react-appany time you need to use it. If you have it installed globally, it'll use whatever version is installed locally on your machine, rather than pulling the latest.I faced the exact same issue today - fixed it by running
Step 1:npm uninstall -g create-react-app
Step 2:npm -g create-react-app@latestFollowed by: Step 3:
npx create-react-app my-applet me know if it helps.
FYI you don't need to have
create-react-appinstalled globally if you're going to usenpxto run it. That's the whole point ofnpx- it pulls the latest version from NPM whenever you run that command. There's no need for Step 2 aboveThat'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... repeatReacted by Mykhaylo Ryechkin, Joe Quigley, Ryan Whelchel, hexudong, Victor Paternina S., apolaina-ineat, Huy Nguyen, William Lubelski and ExcitedDeveloperAgree, 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.
Reacted by Mykhaylo Ryechkinrun
npx create-react-app@5.0.0 app-nameDuring set-up I got the following error:
npm ERR! code ETARGET npm ERR! notarget No matching version found for @babel/plugin-transform-react-jsx-development@^7.16.5. npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist.Actually
npx create-react-app@latest my-appworks and should continue to work with a newer release..?Reacted by Decker Stromso, 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.
Reacted by jestrickler, Joe Quigley, Janhavi, Ryan Whelchel, Victor Paternina S. and apolaina-ineatI also ran into this issue today. I ran all above workarounds such as:
npm uninstall -g create-react-app
npx clear-npx-cache
npx create-react-app@latest my-app --use-npm
npx create-react-app@5.0.0 app-name
andnpx 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!
Reacted by ChuChuDe and Janhavi@NathanMartinez A dumb question: did you try to clear npm cache and do a reboot in addition to the other tries?
@Runejm Very good question actually. I did try clearing out the cache with a few commands I was able to find poking around. I also did try terminating my terminal sessions, however, I didn't think to do a reboot.
I will definitely try that out tonight!
If it does resolve the issue I'll be sure to post it here as well.
Thank you for the insight!
When creating a fresh CRA app, it prints:
You are running
create-react-app4.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
Would be nice if the message included that you probably need to run
npx clear-npx-cachefor the uninstallation to properly take effect.Reacted by Ryan Whelchel, apolaina-ineat and Shaoya HUANGSeem related to #11772
npx create-react-app@5.0.0 app-name
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.Reacted by JanhaviJust fix the issue by running
npm install -g create-react-app@5.0.0Just fix the issue by running
npm install -g create-react-app@5.0.0@chuchude That is the problem. You should not need to install it globally. Using
npx create-react-app app-nameshould always use the latest version without a global install. You can also usenpx create-react-app@latest my-appas a workaround for the issue, but perhaps the React.js documentation needs to be updated if@latestneeds to be included from now on.Yes, I did try the
npx create-react-app@latest my-appandnpx create-react-app@5.0.0 my-app. But it doesn't work either. So I ran thenpm outdatedand I still can see the create-react-app 4.0.3, even though I have run the uninstall command. So I just manually install the 5.0.0. And then runnpx create-react-app myapp. And It works. I guess something wrong with my PC. I don't quite understand why.When creating a fresh CRA app, it prints:
You are running
create-react-app4.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
Would be nice if the message included that you probably need to run
npx clear-npx-cachefor the uninstallation to properly take effect.Tried it after uninstalling the global install of create-react-app using
npm uninstall -g create-react-app, it got stuck in the same loop again:First run:
npx clear-npx-cache
Need to install the following packages: clear-npx-cache Ok to proceed? (y) ySecond run:
npx clear-npx-cache
Need to install the following packages: clear-npx-cache Ok to proceed? (y)Pretty sure that's not how it's supposed to be!
J
Describe the bug
When attempting to use
npx create-react-app <app-name>, I get the following error:What I have tried to fix it:
npm uninstall -g create-react-appto uninstall any global versions of create-react-appnpm i -g npm@latestto update npmnpm 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 infocommand ends up with the same error.I am currently on Mac v12.0.1. Please request more info if needed.
Steps to reproduce
npx create-react-app <app-name-here>Expected behavior
A React app is created.
Actual behavior
create-react-apperrors due to incorrect version.