coreybutler / nvm-windows

A node.js version management utility for Windows. Ironically written in Go.
MIT License
37.28k stars 3.32k forks source link

[Issue]: npm i taking to long when running through nvm-windows #1125

Closed contibru closed 4 months ago

contibru commented 5 months ago

What happened?

When I am executing a npm i command with the nvm-windows turned on, the time to get all packages is takeing to much time. I already disabled all ipv6 resources and the issue is still happening. When I turn off the nvm by using nvm off command and then trying to execute npm i again using the node installation directly, everything works fine and fast. Also, even with the IPv6 disabled, nvm debug is showing enabled.

IPV6 disabled: image

What did you expect to happen?

The time Downloading packages should be the same with or without nvm-windows or at least pretty equals.

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 11+

Which locale?

English (Default)

Which shell are you running NVM4W in?

PowerShell

User Permissions?

Administrative Privileges, Elevated

Is Developer Mode enabled?

No (Default)

Relevant log/console output

No response

Debug Output

Running NVM for Windows with administrator privileges.

Administrator: PowerShell
Windows Version: 10.0 (Build 22631)

NVM4W Version:      1.1.12
NVM4W Path:         C:\Users\conti\AppData\Roaming\nvm\nvm.exe
NVM4W Settings:     C:\Users\conti\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\conti\AppData\Roaming\nvm
NVM_SYMLINK:        E:\nvm\node
Node Installations: C:\Users\conti\AppData\Roaming\nvm

Total Node.js Versions: 3
Active Node.js Version: v21.7.1

IPv6 is enabled. This can slow downloads significantly.

No problems detected.

Anything else?

No response

coreybutler commented 5 months ago

npm doesn't run through NVM for Windows. NVM4W creates a symlink to executables, so they are all run directly.

NVM4W checks to see if the ::1 address is available, which is how the OS indicates IPv6 is active.

From the description, it sounds like IPv6 isn't really turned off. It's entirely possible NVM4W may need a more explicit check, but if you're getting slow downloads on an app that doesn't touch NVM, something else is likely slowing it down... and IPv6 seems like a strong candidate.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled for 7 days with no activity.