I got an error while creating a React application. How do I fix it?

- 30,738
- 21
- 105
- 131

- 4,539
- 3
- 9
- 14
-
2Have you tried running the commands that it recommends? `npm uninstall -g create-react-app` – Brandon Dec 15 '21 at 05:02
-
13@BrandonDuffany Ya, I tried, But again shows the same error. – Athif Saheer Dec 15 '21 at 05:08
-
https://stackoverflow.com/questions/70358474/error-while-creating-new-react-appyou-are-running-create-react-app-4-0-3-whi/70488154#70488154 – Abolfazl Roshanzamir Dec 26 '21 at 16:48
-
when it prompts you to proceed, instead pressing enter, make sure to press 'y' – Embedded_Mugs Feb 13 '22 at 10:45
6 Answers
Try running this:
npx clear-npx-cache

- 9,715
- 2
- 2
- 3
-
58This worked for me as well. I think this should be marked as the correct answer as it doesn't require forcing the latest version. – Patrick Haertel Dec 18 '21 at 19:08
-
1This worked for me too. This issue happened even after a fresh install of node js. This fix worked like a charm. <3 – emkarachchi Jan 20 '22 at 15:08
-
10
-
4This is the correct answer I tried to find more details. Based on the response from James L here: https://stackoverflow.com/questions/63510325/how-can-i-clear-the-central-cache-for-npx create-react-app is still in npx cache memory even though it is not installed globally so clearing the npx cache using the command above solves it. – BoyePanthera Mar 28 '22 at 14:34
-
1this fixed my issue also, no idea why this is crashing. but thanks – DRProgrammer Mar 30 '22 at 14:46
-
If you don't want to download `clear-npx-cache`, run `rm -rf ~/.npm/_npx` instead – Codler May 30 '22 at 11:42
-
This didn't work for me, running `npm update npx` and then `npx create-react-app my-app` worked – ida Jun 02 '22 at 04:53
-
-
It's fixed. I do npx create-react-app@5.0.0 my-app
.

- 30,738
- 21
- 105
- 131

- 4,539
- 3
- 9
- 14
-
3Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 15 '21 at 06:04
-
8Do `npx clear-npx-cache` if you don't want to have to specify the cra version. – Michael Fulton Jan 02 '22 at 17:23
-
5I could solve this problem using `npx create-react-app@latest my-app` – vinhtranchau Jan 10 '22 at 10:44
-
1After clearing the cache for npm for almost 30 minutes to no avail. This worked for me. Sometimes you need to slow down and refocus. npx not npm – blakroku Jan 13 '22 at 14:38
npx clear-npx-cache
worked for me.
Try npx clear-npx-cache
to clear your npx cache and then running the npx create-react-app your-app.
Additionally, it might be worth trying to force the latest version with:
npx create-react-app@latest my-app --use-npm

- 1,842
- 9
- 18
It's solved. By using this code:
npx create-react-app@5.0.0 my-app
If it does not work, use this and try again:
Delete everything from C:\Users\your_pc_name\AppData\Roaming\npm-
cache
This could be a local caching issue. Try the command npm cache clean --force
using administrator mode in your terminal and then try again with the same command - npx create-react-app my-app
.

- 479
- 3
- 7
Follow this:
npm uninstall -g create-react-app
npm cache clean --force”
npm cache verify
npx create-react-app my-app

- 339
- 1
- 5
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.
this works--npx create-react-app@5.0.0 my-app

- 55
- 2