33

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

Microsoft Windows [Version 10.0.19044.1586]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Olususi Victor>cd documents

C:\Users\Olususi Victor\Documents>cd react folder

C:\Users\Olususi Victor\Documents\React folder>npx create-react-app blog

You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1).

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

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/


C:\Users\Olususi Victor\Documents\React folder>

Image of error

2
  • Have you tried the commands that the error throws? I mean, it says to you exactly what to do: uninstall create react app package and install it again Apr 13, 2022 at 5:45
  • 1
    Thanks, I have resolved it, i just uninstall and install the package again Apr 13, 2022 at 6:55

25 Answers 25

91

Run the following 3 commands sequentially:

npm uninstall -g create-react-app
npx clear-npx-cache
npm i create-react-app
npx create-react-app@latest my-app
4
  • 2
    you miss npm i create-react-app
    – Ale DC
    May 18, 2022 at 9:00
  • 1
    shouldnt it be npm install -g create-react-app ??, in case of gloabl installation
    – Manish
    May 30, 2022 at 18:16
  • 9
    I only needed npx clear-npx-cache and then it stopped complaining. I didn't have create-react-app installed at all (not globally, not locally). npx was just being dumb.
    – Radu C
    Sep 19, 2022 at 22:04
  • Can you add an explanation on this solution to improve this answer? Jun 19 at 20:02
10

MacOs 12.3.1 - Node v16.3.0 - NPM 7.15.1

I tried a lot of possible solutions, but the only one that worked for me was to uninstall CRA globally AND locally.

So, you have to run:

npm uninstall -g create-react-app

npm uninstall create-react-app

npx clear-npx-cache
1
  • This one worked for me. After this command try the following - npm i create-react-app, npx create-react-app@latest my-app
    – Shamseer
    Sep 9, 2022 at 4:56
6

I had the same problem, uninstalling create-react-app and installing the latest version solved the problem:

npm uninstall -g create-react-app
npx clear-npx-cache
npm cache clean --force
npm install -g create-react-app@latest

then you can create your react app with

npx create-react-app your-app-name
6
npx clear-npx-cache
npx create-react-app@latest app-name

Worked for me

2

Have you installed react globally? if yes, then remove it using

npm uninstall -g create-react-app

and then run your

npx create-react-app blog

if still you face the same issue than try creating a blog folder and inside that folder, run

npx create-react-app .

may be it will fix your issue.

2

This worked for me

npm uninstall -g create-react-app
npm i create-react-app
npx create-react-app my-app

still not sure what happened thou

2

Had this issue today (running node v16.13.1). Exact error message read:

You are running `create-react-app` 5.0.0, which is behind the latest release (5.0.1). 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

The latest instructions for creating a new app can be found here: https://create-react-app.dev/docs/getting-started/

Solution that worked:

 1. npm uninstall -g create-react-app
 2. npm install -g create-react-app
 3. npm cache clean -f
 4. npx create-react-app my-app
2

The solution that works for me:

  1. npm uninstall -g create-react-app
  2. yarn uninstall -g create-react-app
  3. npm i -g create-react-app
2

Try this: npm uninstall -g create-react-app. Then open: C:\Users\Your_user_name\AppData\Roaming\npm-cache delete everything in the folders. Open: C:\Users\Your_user_name\AppData\Roaming\npm delete everything related to create-react-app.

Then finally: npx create-react-app my-project Worked for me. Good luck!

1

I also encountered this problem and by installing the package with yarn, everything works! Even removing then reinstalling with npm, it didn't work. Here is my solution

yarn add create-react-app
create-react-app {app_name}
1

I also encountered in this problem, I solved my issue by clearing the cache!

npm cache clean --force
1

If anyone is still facing that problem after uninstalling it globally and cleaning the cache, try to run;

npm uninstall create-react-app

as you might have a non-global installation

1
  • Your 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.
    – Community Bot
    Apr 26, 2022 at 1:49
1

This worked for me

npm uninstall -g create-react-app
npx create-react-app@latest
1

I was able to solve mine by uninstalling Nodejs from my computer and then downloading the lastest one on my computer again.

1

this worked for me.

npm uninstall -g create-react-app
npm uninstall create-react-app
npm cache clean --force
npm install create-react-app@latest
1

if none of the answers worked for you, try adding this command after uninstalling the create-react-app package.

npm i create-react-app
1

I solved it with this:

  1. npm uninstall -g create-react-app
  2. npm install create-react-app@latest
1

Did you try with yarn? This works for me!

  1. yarn global remove create-react-app

  2. yarn create react-app my-app

Hope it works :)

1
  1. npm uninstall -g create-react-app
  2. npm install -g create-react-app
  3. npx clear-npx-cache
  4. npx create-react-app@latest my-react-app

...and u will be good to go. go ahead with command like cd my-react-app npm start

1

Actually I updated my script, I uninstalled react global and reinstalled but nothing changed. But yarn still works. I am still trying to solve problem but for a while, I will use

yarn create react-app my-app

1

npm uninstall -g create-react-app

npx clear-npx-cache

0

''' create-react-app projectName --template typescript '''

1
  • 1
    As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 11, 2022 at 8:56
0

have you tried this

npm uninstall -g create-react-app

npx create-react-app@latest blog
1
  • While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. You can find more information on how to write good answers in the help center: stackoverflow.com/help/how-to-answer . Good luck
    – nima
    Nov 2, 2022 at 8:10
0

For me,

npm uninstall -g create-react-app

and

npx create-react-app@latest opus

enter image description here

0

you can use this command

npx [email protected] app-name

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.