'Keep getting error while creating react app
I have been trying to create a react app, so basically a new project such as hello world or anything.
I try using npx create-react-app my-app
The error I get is:
You are running `create-react-app` 4.0.0, which is behind the latest release (4.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/
I try following those steps and even uninstalled using npm uninstall -g create-react-app
but I still keep getting the same error.
My npm version: 6.14.8
This is such a basic process to create a first application in react I am not sure why is it so complicated. Could someone please tell how can I fix that error and also how can I create an react app smoothly?
If more information is needed please feel free to comment down below:)
Solution 1:[1]
npm install -g create-react-app
Above fixed it for me.
Solution 2:[2]
Worked for me:
npm uninstall -g create-react-app
npm install -g create-react-app
npx create-react-app app-name
Solution 3:[3]
I tried with this command. It worked
npm install -g create-react-app
npx create-react-app my-app
Solution 4:[4]
I had the same problem. So what I did is:
npm uninstall -g create-react-app
npm install create-react-app --save
npx create-react-app my-app
and it worked. The second line, I think, is to have create-react-app
locally.
Solution 5:[5]
Dont worry ,it can be fixed by installing create-react-app globally
run these two lines and it can be fixed
npm install -g create-react-app
npx create-react-app your-app
Solution 6:[6]
I solved it using the following command.
npm uninstall -g create-react-app
then
npm install -g create-react-app
Afterwards you should be good to go with npx create-react-app my-app
:)
Solution 7:[7]
You need to use below command for creation of new project.
npx create-react-app applicationname
Solution 8:[8]
I put in the code npm uninstall -g create-react-app and I get the below its not deleted anything PS C:\Users\deann> npm uninstall -g create-react-app
up to date, audited 1 package in 435ms
found 0 vulnerabilities
then I put
PS C:\Users\deann> npm install create-react-app npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
added 67 packages, and audited 68 packages in 4s
4 packages are looking for funding
run npm fund
for details
3 high severity vulnerabilities
Solution 9:[9]
The two commands helped me when I came across with this issue.
npm uninstall -g create-react-app - this uninstalles the old version
npm install -g create-react-app - this installes the new version
then put the command npx create-react-app name-of-folder
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow