nvm-windows
nvm-windows copied to clipboard
Environment variables duplicated in User Profile and System
Upon installation on a clean system running Windows 10, the installer creates the following environment variables for both "System" and the current users profile: NVM_HOME NVM_SYMLINK
Furthermore, it appends to the system environment variable for Path
, but then also saves the entire Path
environment variable under the user profile, erroneously making the actual working path gigantic (since system Path
and user profile Path
are concatenated). You can confirm by viewing from a new command prompt (started after the installer makes the changes) by typing "path" (or "set" to see all environment variables).
Since default behavior is to symlink into a user profile path, I believe that the correct result of the installer should be to:
- Add
NVM_Home
andNVM_SYMLINK
environment variables to the user profile (not to system) 2) Append%NVM_HOME%;%NVM_SYMLINK%
to only thePath
environment variable for the user profile (not to the system).
After installing nvm I had the issue that the nvm command was not recognised. After I changed my environment variables to what PlatinumEagle suggested (variables and path in user profile) it worked. So I would +1 the suggestion of PlatinumEagle.
@gingters - which version of Windows are you running this on?
This was a requirement on Windows 8.0. The whole variablized PATH
was created so the software could easily be uninstalled later. This choice was motivated by challenges with the InnoSetup installer. However; this whole process will likely be scrapped in favor of far simpler uninstallation support with the BitRock installer.
I'm leaving this open for now. I'll close it when I finally get around to releasing the next installer.
Just installed today on a new pc running Windows 10 and ran into this issue.
+1 to @PlatinumEagle 's fix
I have the problem that I have two account at my work. a "normal-user" and a "admin-user". If I install nvm he writes the env values to the "admin-user".
but normally i run nvm with the "normal-user" and than he dont know node or nvm as a command, because the path command gives me: PATH: ...C:\Program Files\TortoiseGit;%NVM_HOME%;%NVM_SYMLINK% Maybe don't use vars for the path?
Thanks!
@crazyx13th - which version of Windows are you on? Some people have experienced problems on Windows 8 with the variable approach.
Win7 x64, but I think the Problem is that the account for installing nvm and the account for using nvm are nor the same. thx
@crazyx13th - NVM4W sets the PATH
at a system level, so it should be available to all accounts. If the account doesn't have administrative privileges, then many features won't work, but it shouldn't prevent you from running a node script under a normal account.
On Windows 7, which is unsupported (reached EOL), you can manually change the variables to the physical path.
yeah, this was my solution at my agancy too. set the path manually. but then all is working! only if i want to change a version I had to insert my admin pwd, but this is no problem...
Leaving myself this note to check in the Chocolatey package I'm updating to add an option to create User only for the NVM_* variables and update the USER's path as well as the option to install everything system-wide (the default since much of chocolatey gets used for automation where USER only settings aren't valuable).