Skip to content
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

NPM Install taking hours on Win 11 / WSL #104

Open
jstrugnell opened this issue Jan 8, 2025 · 5 comments
Open

NPM Install taking hours on Win 11 / WSL #104

jstrugnell opened this issue Jan 8, 2025 · 5 comments
Labels

Comments

@jstrugnell
Copy link

Hi,

I've been exploring the use of Dev Containers to simply my SPFX dev setup but I'm experiencing prohibitively slow NPM installs. I'm installed the latest Docker Desktop and enabled WSL (2) on my Win 11 laptop. When trying to load one of the SPFX samples that is configured with dev containers, the NPM Install is taking 2-3 hours to run. To be honest I've not even seen it complete yet, as I always cancel to try to resolve the issue. I've just tried it on another machine, and the same is happening.

I guess my first question is whether this expected or not? Or if this is a recent issue/bug somewhere. Or if there is a problem with my configuration.

Is anyone else seeing this?

@shurick81
Copy link
Contributor

I have some numbers that you could expect for npm install: when I measured this on WSL, it was 232 seconds. Here's the measurement details: https://www.linkedin.com/pulse/performance-measurements-spfx-dev-environment-aleksandr-sapozhkov/?trackingId=Qd8oZ7rATgK0UE%2FlDdZpgQ%3D%3D. Maybe you could repeat the same steps and see how it works?

@jstrugnell
Copy link
Author

Thank you, that's an interesting article 🙂. The 2 environments I've tried this on were my Dell XPS laptop and a freshly built VM in Azure. Both are reasonably powerful machines, running the latest software (i.e. Win 11 24H2), so I don't think we can put the slowness down to hardware. Running "NPM Install" on the bare machine is roughly comparable with your numbers, it's only when I use the dev containers approach that the slowness starts occurring.

By the way, the NPM Install that was running when I created this issue, is still running now (3+ hours). It took around 20 minutes before the "node_modules" folder even appears in Windows (empty).

I'll perhaps try an even more powerful Azure VM, and use an older version of Windows also, just to rule that out. I did consider creating a Windows Dev Drive on my laptop also, but I'm not an Admin on the machine so I've not got that working yet.

@jstrugnell
Copy link
Author

I've tried various things and I seem to have a different (better) experience when I build the container from a dockerfile myself, rather than from these pre-built images. Could that be anything to do with them being ARM-based, when I'm running x64 hardware?

@jstrugnell
Copy link
Author

I only say that because I get this message in the Docker Desktop UI:
image

@waldekmastykarz
Copy link
Member

I've tried various things and I seem to have a different (better) experience when I build the container from a dockerfile myself, rather than from these pre-built images. Could that be anything to do with them being ARM-based, when I'm running x64 hardware?

Good catch. You could easily test it by taking an older image, say 1.16.1, which is amd64 and seeing if you can repro the issue or if it works as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants