-
-
Notifications
You must be signed in to change notification settings - Fork 27k
npm start performance issue > 5 minutes #9299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
An update on this as i've been trying different things out. once that's installed, i run npm start and the server starts within 10 seconds. What this tells me is that:
Hope this helps! PS. unfortunately I can't use the boilerplate as the file/directory structure is completely different from the tutorial that i'm following. So... you're help would really be appreciated. |
I always delete the default created js files and create my own . Its works fine and yes it would be easy to clarify this if you let us know hoe to produce the error again. |
@HemanthDavuluri , thanks for taking the time to reply! I really appreciate it. Which default js files do you mean? I've already tried removing all files from the src folder and running with an extremely simple index.js that does a console.log('test'); To re-create it i do the steps:
I'm a complete novice at react and nodejs. So, can you advise on how i can monitor the npm start, so that i can see which process it is that is taking ages to start up? For example is there any way of seeing something like |
Yes even i delete the complete src folder and recreate it . i dont know what is the problem that is leading more build time on your machine! |
Just to keep you guys in the loop. It turns out this was a WSL2 issue. For details on how to resolve check out : https://docs.microsoft.com/en-us/windows/wsl/compare-versions#use-the-linux-file-system-for-faster-performance This one simple change solved the problem and it's running faster than Lightening McQueen! |
Thanks a lot!!! |
Hi, as for me, I don't use WSL, I have ubuntu directly installed on my computer and npm takes too long to start, anybody who knows what could be the issue ? my hardware is quite reliable (16Gb ram, i5 6th gen CPU) |
Can you please bring more details here about this one simple change? |
@IIT-Bhupendra: Here's the issue I logged with WSL #5705 If that doesn't answer your question, can you be specific please? |
@DiegoMcDipster: Actually, I was having a similar issue that you have mentioned in #5705, i.e., |
@IIT-Bhupendra, Good to hear! Happy hacking! |
For better performance avoid developing react artifacts within /mnt/ path as they access the windows path via a proxy, this makes the npm start awfully very slow. move your project under /home path of your WSL2 instance (this is a path internal to VM) and run the npm start from there mine started at a blasting speed - My project path now is - ~/dev/react/ReactProjects/my-app |
I had this issue where the bare bones app created by create-react-app was taking 2 minutes to finish when running start. I tracked the issue down to the openBrowser function. You can eliminate this function from startup either by ejecting and then editing the start script or by modifying the start text in package.json to "BROWSER=none react-scripts start". Then you will need to open the browser manually, but many people prefer that start does not open the browser window when it runs anyway which is why I think BROWSER=none exists as a parameter. |
Hi,
I just:
This takes over 5 minutes to return 'Compiled Successfully'.
localhost:3000 shows the default page. So, that seems to be working fine... it just takes an age to get to it.
Console has the first line : [HMR] Waiting for update signal from WDS...
I am running WSL2.
Ubuntu 18.04.4
Windows 10 Home Insider Preview.
Build 20161.rs_prerelease.200627-1754.
Also note (I'm not sure if this is relevant) I have been able to successfully run nodejs applications without any problems. But they used the command "npm run ..." & nodemon.
Your help would really be appreciated! I just started a tutorial and it's impossible to follow it with this performing so badly.
Regards!
The text was updated successfully, but these errors were encountered: