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]: C:\Program Files\nodejs not added to the environment variable path #1141

Closed sawa-ko closed 3 months ago

sawa-ko commented 4 months ago

What happened?

Currently when I install nvm, the C:\Program Files\nodejs path is not added to the windows path environment variable, so certain programs crash because they try to look for that environment variable to have that path since the nodejs installer for windows does it.

What did you expect to happen?

Have the path C:\Program Files\nodejs added to the windows path environment variable.

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 11+

Which locale?

Other Non-English

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.

Administrador: Windows PowerShell
Windows Version: 10.0 (Build 22631)

NVM4W Version:      1.1.12
NVM4W Path:         C:\Users\Kaname\AppData\Roaming\nvm\nvm.exe
NVM4W Settings:     C:\Users\Kaname\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\Kaname\AppData\Roaming\nvm
NVM_SYMLINK:        C:\Program Files\nodejs
Node Installations: C:\Users\Kaname\AppData\Roaming\nvm

Total Node.js Versions: 1
Active Node.js Version: v22.2.0

IPv6 is enabled. This can slow downloads significantly.

No problems detected.

Anything else?

No response

coreybutler commented 4 months ago

How did you install NVM4W? The installer adds %NVM_SYMLINK% and %NVM_HOME% to the PATH. In your case, that resolves to C:\Program Files\nodejs

sawa-ko commented 4 months ago

Yes, but for example Jetbrains ides does not detect it if it is not the full path instead of an alias. And I installed it using the .exe from the releases page (1.1.12).

coreybutler commented 4 months ago

If that is true, then Jetbrains isn't using the PATH at all. It sounds like it is using a hard-coded directory path, which some applications do. Specifying C:\Program Files\nodejs in Jetbrains should work. If it doesn't, it likely means Jetbrains isn't following symlinks and there's nothing that can be done. That would be a pretty big oversight in Jetbrains and I would suggest opening an issue with them if that is truly the case.

Can you run nvm use 22.2.0 and node --help from a terminal/powershell (not within Jetbrains)? If both of those functions work, then NVM4W is functioning as expected.

github-actions[bot] commented 3 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.