How to install nvm for windows 10 and set up for all users

11.4k Views Asked by At

Problem

I need to install nvm for windows 10 and have it work for my admin profile and my non admin profile. When I do all my programming it's with my regular user account. But to install things / admin stuff, I have to provide an admin account.

Details I downloaded and ran the latest installer from this repo:

install nvm for windows 10: https://github.com/coreybutler/nvm-windows

WHen I try to run the installer, I have to use my admin account. Windows prompts me for it and after I supply the creds, the setup completes without any issues. The problem is that nvm only works when I run a command window as my admin user ... but I need to be able to run nvm as my regular non priv. user as well.

So right now, when I open a "command" window as admin, i can run

Microsoft Windows [Version 10.0.19043.1348]
(c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>nvm --version

Running version 1.1.9.

But if I run command just as my regular user,

Microsoft Windows [Version 10.0.19043.1348]
(c) Microsoft Corporation. All rights reserved.

C:\Users\me>nvm --version
'nvm' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\me>

Any tips would be appreciated.

EDIT 1

enter image description here

enter image description here

4

There are 4 best solutions below

2
On BEST ANSWER

Used the registry editor to add 2 new string varaibles to the regular user's profile. Can't do it through the Control Panel GUI because I'm always forced to use elevated credentials to access the control panel. And then when I do edit the User's environment vars, it's for the admin account only. So now when I open up a command window and run the "set" command, it includes these two variables:

NVM_HOME=C:\Users\<nonAdminUser>\AppData\Roaming\nvm
NVM_SYMLINK=C:\Program Files\nodejs

And now everything just works.

0
On

In my case it works without registry editing:

  1. Switch to admin account
  2. Go to nvm folder and add share it with user.
  3. Switch to user account.
  4. Add %NVM_HOME% and %NVM_SYMLINK% to user PATH variable
  5. Restart cmd.
1
On

I had the same issue. After installing it, I couldn't run nvm or node from my normal account. Rebooting did not help. I even had a difficult time uninstalling it so that I could try again due to permissions.

I did the following on my second attempt and it seems to have worked. It even created the correct environment variables under my normal account, which was a bit surprising. Regardless, it worked for me, so I thought I'd share in case it helps someone else.

  1. Run the installer.
  2. When prompted, enter admin credentials.
  3. When it asks for the install location, I change the username portion of the path to be my non-admin username.
  4. Ran the rest of the installation as normal.

After doing the above, I was able to run nvm under my normal account. When switching to a specific version of Node with "nvm use xx.xx.x" I was prompted to enter my admin credentials, but once it finished I was able to use node with my normal account.

0
On

when installing nvm

  1. select destination location select browse > then "Program Files" folder should say C:\Program Files\nvm

enter image description here

  1. follow rest of default prompts
NVM_HOME=C:\Program Files\nvm
NVM_SYMLINK=C:\Program Files\nodejs