Hello, when I’m using the creat-react-app it takes really long time, something like 20minutes. What is causing this problem and how can I fix it?
Could you add the code here?
What takes 20 minutes. Installing it? Compiling the code once it’s installed?
You need provide a lot more detail here
Sorry, I meant creating an app using
What excatly code should I share,
So what are the errors, what does the console say when you run that command? At what point does it hang?
It doesn’t hang or stop, it just takes like 20-30minutes, so I’m asking why is it so long and how could I speed it up, I didn’t said there is any error
We’ll it should run the setup scripts in maybe 20-30 seconds, so I’m gonna say something is erroring or hanging. 20-30 minutes to run those scripts means something is wrong, it’s not a normal thing that people deal with.
We don’t know because just saying “it takes 20-30 minutes” isn’t useful in its own. What, specifically are you installing - is it a specific version? What process did you follow? Are you following some guide (you’re installing the create-react-app program globally, which isn’t recommended in the docs, so I’m adding you’re following some guide)? What are you installing it on? Etc.
I installed the
create-react-app globally so maybe that is the issue? My react-scripts version is 3.4.1. I’m not following any guide, it just happens every time I’m typing in the console
create-react-app <app-name> to creat template for my app.
HEY MAYBE IT’S RELEATED TO UR BANDWITDTH OR INTERNET SPEEED , I AM NOT SURE BUT FOR ME IT TAKES 5 MINS TO RUN create-react-app
I do not know if you want to use all the dependencies comes with npm create-react-app but if it is the basic project you want to setup you can simply use parcel-bundler to create your react app. It takes so much less time and size to load.
There is a Bob Ziroll method you can find here:
@bartekw2213 Yep, I also feel the pain. Creating react app taking sometimes more than 20 minutes. Is there a way to optimize while creating app, which can take lesser time. @DanCouper Just creating the app installing all the node depenencies take a lot of time.
create-react-app takes about 12 minutes on my slow laptop and two or three minutes on my new i5 desktop.
You might find https://github.com/nano-react-app/nano-react-app to fit your needs.
@bartekw2213 I have found the solution, it is working fine for me. If you are using windows then check your task manager, If the disk capacity goes beyond 100% which can result in slow installation of app. Because it helps the system to read and write.
And the other thing is try yarn, which is pretty much faster than npm.
For me it took around 3 - 4 minutes which is pretty cool and awesome
Try if it works, Hope this helps ![1|690x112]
Happens for me too. It has nothing to do with the system I feel because I am running this from a 2019 Macbook pro 16 inch model with a 70Mbps connection working fine.
Tried a couple of times. Taking too long. Not sure what is the reason
Remove global create-react-app package, if you have it installed globally.
npm uninstall - create-react-app
Install/update react and react-dom globally
npm i -g react react-dom
Then try setting up the react app:
npm init react-app my-app
Hi, For me the basic issue with my HDD. I recently upgraded my lap with SSD and I also tried with different options. It is working fine for me now. It take me at max 2 - 3 minutes.
If you are using HDD or SSHD the read and write operation for the disk will be slow and it can cause a lot of time. Try to use SSD which is pretty faster.
Uninstall the global NPX and whenever you create the project it will install the latest module of NPX and install much faster.
These two options solved my problem. Hope it helps.