Reputation: 473
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>
Upvotes: 37
Views: 33332
Reputation: 1324
For me,
npm uninstall -g create-react-app
and
npx create-react-app@latest opus
Upvotes: 0
Reputation: 107
npx clear-npx-cache
npx create-react-app@latest app-name
Worked for me
Upvotes: 7
Reputation: 11
have you tried this
npm uninstall -g create-react-app
npx create-react-app@latest blog
Upvotes: 0
Reputation: 21
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!
Upvotes: 2
Reputation: 31
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
Upvotes: 1
Reputation: 147
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
Upvotes: 6
Reputation: 11
npm uninstall -g create-react-app
npm install -g create-react-app
npx clear-npx-cache
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
Upvotes: 1
Reputation: 11
Did you try with yarn? This works for me!
yarn global remove create-react-app
yarn create react-app my-app
Hope it works :)
Upvotes: 1
Reputation: 31
The solution that works for me:
npm uninstall -g create-react-app
yarn uninstall -g create-react-app
npm i -g create-react-app
Upvotes: 2
Reputation: 11
I solved it with this:
npm uninstall -g create-react-app
npm install create-react-app@latest
Upvotes: 1
Reputation: 111
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
Upvotes: 10
Reputation: 1016
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
Upvotes: 97
Reputation: 2257
if none of the answers worked for you, try adding this command after uninstalling the create-react-app package.
npm i create-react-app
Upvotes: 1
Reputation: 11
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
Upvotes: 1
Reputation: 11
I was able to solve mine by uninstalling Nodejs from my computer and then downloading the lastest one on my computer again.
Upvotes: 1
Reputation: 11
This worked for me
npm uninstall -g create-react-app
npx create-react-app@latest
Upvotes: 1
Reputation: 11
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
Upvotes: 1
Reputation: 63
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
Upvotes: 2
Reputation: 21
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
Upvotes: 2
Reputation: 101
I also encountered in this problem, I solved my issue by clearing the cache!
npm cache clean --force
Upvotes: 1
Reputation: 134
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}
Upvotes: 1
Reputation: 119
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.
Upvotes: 2