DEV Community

Cover image for Install Node Version Manager (NVM) without Admin Rights

Install Node Version Manager (NVM) without Admin Rights

Emanuele Bartolesi on June 02, 2022

NVM (Node Version Manager) is the best way to run multiple versions of NodeJS on the same machine. It's not only for Windows but in this post I wil...
Collapse
 
nedvargar profile image
NedVargar

This worked for me. Thank you! One additional step I needed was to add my Dev group to the Create Symbolic Links local policy. Found here: Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment -> Create Symbolic Links

Without this, the version switch wouldn't work. I configured it in a domain GPO

Collapse
 
jdanl89 profile image
jdanl89

nvm use will still fail because you do not have admin rights.

To circumvent this, update the NVM_SYMLINK environment variable from C:\tools\nvm\nodejs to C:\tools\nvm\v20.12.2. (I'm using Node v20.12.2, if you're using a different version, then the folder name will be different.) (You will need to close and reopen the command prompt after changing the env var.)

Further details:
The nvm use command basically just changes the NVM_SYMLINK env var to the name of the folder containing the desired version of Node. It is trying to change the system-level env var, but if you're following this article, you created it as a user-level env var. nvm isn't smart enough to know that.

Collapse
 
sidharthsreekumar profile image
Sidharth Sreekumar

I have tried but for it to fully work, I think we need admin rights. After following the steps nvm command works but fails when I try to install node by using nvm install latest. I am getting the following error.

C:\dev-tools\nvm could not be found or does not exist. Exiting.
Downloading node.js version 16.15.1 (64-bit)...
Error while creating C:\dev-tools\nvm\v16.15.1\node.zip - open C:\dev-tools\nvm\v16.15.1\node.zip: The system cannot find the path specified.
Could not download node.js v16.15.1 64-bit executable.

Is this something you have also come across?

Collapse
 
kasuken profile image
Emanuele Bartolesi

Did you try to remove the - symbol in the folder name?

Collapse
 
sidharthsreekumar profile image
Sidharth Sreekumar

I haven't yet. Will try and let you know. Thanks for the suggestion.

Thread Thread
 
kaushik_ganguly_389c8fc30 profile image
Kaushik Ganguly

Have you got the fix

Collapse
 
bestmed profile image
Mohammed

Thanks, working perfect here ;)
I guess we all know you are referecing "Path" variable and not "Patch" in here :

Now you can update the Patch value with the two new values: %NVM_HOME%;%NVM_SYMLINK%

Collapse
 
geertclaes- profile image
Geert • Edited

Managed to get temp admin to add System Properties. npm install lts and latest worked fine too. However, why do I need admin right when setting the current node version? nvm use ... requires admin login?

Collapse
 
revalenza profile image
Robert Valenzuela

this wont work because symlink require admin rights to work

Collapse
 
discodan profile image
Disco Dan Silva

I get the following error when I try nvm use 6.11.0:
exit status 1: You do not have sufficient privilege to perform this operation.

Collapse
 
njalbuero profile image
Nhielsan Albuero

Doesn't work for me, first off I can't edit system environment variables without admin rights.

Collapse
 
andrewbaisden profile image
Andrew Baisden

Nice tutorial I use it on macOS. So much better for doing development because you can switch versions on the fly.

Collapse
 
kasuken profile image
Emanuele Bartolesi

in Windows as well... if you have a "normal" account.