Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create-react-app only creates package.json, package-lock.json and node_modules

This is my first react app. I'm working on windows 10, node version 10.15.3, npm version 6.4.1. This when i execute create-react-app command:

C:\Users\hp\Desktop>npx create-react-app app2
npx: installed 91 in 30.086s

Creating a new React app in C:\Users\hp\Desktop\app2.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

+ [email protected]
+ [email protected]
+ [email protected]
added 1404 packages from 727 contributors and audited 888973 packages in 
237.52s
found 0 vulnerabilities

It just get stuck after this I waited for almost 20 minutes but nothing happened ,no success message or information about commands like npm start is displayed and I have to do ctrl+c to terminate the batch job. The project folder created contains only package.json, package-lock.json and node_modules and package.json file does not have start,build,test and eject script Can anyone please help me I am not getting what is wrong here

like image 934
yashraj singh Avatar asked Oct 21 '25 09:10

yashraj singh


2 Answers

Try to update the npm package:

npm install -g npm

And then install create react app again:

npm install -g create-react-app

And create the project again

like image 172
Diego Avatar answered Oct 26 '25 20:10

Diego


I fixed it in three steps:

  1. npm uninstall -g crete-react-app

  2. yarn global add create-react-app

  3. yarn create react-app my-app

It will work!

like image 32
sifan.peng Avatar answered Oct 26 '25 19:10

sifan.peng