Access Denied issue with NVM in Windows 10

node.jsWindows

node.js Problem Overview


I'm getting 'access is denied' when I'm using nvm -v command in windows 10. I have got the similar issue here https://stackoverflow.com/questions/48762782/nvm-is-access-denied

But he himself gave a solution which is not working for me.

Is there any solution for this problem?

node.js Solutions


Solution 1 - node.js

I encountered the same issue and solved it as follows:

  1. Uninstall "NVM for Windows 1.1.7"
  2. Run the installer nvm-setup.exe as Administrator
  3. Open an elevated Command Prompt (with Administrator privileges) and run
  • nvm install 8.12.0
  • nvm use 8.12.0

Now running node -v in a non-elevated Command Prompt works without issue. Hope this helps!

Solution 2 - node.js

Not like the other comments, you don't have to run the installer nvm-setup.exe as Administrator. Just install it like a normal software.

Make sure that when you run nvm use xxx, you run it in Command Prompt with Administrator privilege.

Solution 3 - node.js

  1. Install nvm-setup.exe as Administrator
  2. open cmd.exe as Administrator
  3. nvm install 14.17.6
  4. nvm use 14.17.6

Solution 4 - node.js

My problem occurs on, particularly, Visual Studio Code.

The solution for my case is to run Visual Studio Code as an Administrator.

Solution 5 - node.js

I know this is a relatively old post and I believe most people landing here are trying to solve the access denied feature introduced with nvm 1.1.8 - I hope this is helpful to those folks.

This is covered in the repos wiki here

If you have access to enable developer mode on your machine - docs

You can enable developer mode and then when installing nvm for windows choose an install directory outside of the protected "Program Files" folder for nvm and nodejs.

I went with c:\Programs\nvm and c:\Programs\nodejs respectively, but you could also use APP_DATA as the base for both, or as suggested in the wiki 'nvm4w'.

I'm now able to use the latest nvm and run 'nvm use x.x.x' inside of VS Code.

Solution 6 - node.js

  1. -->Press window key + x.
  2. -->Windows PowerShell(Admin)
  3. -->Now use nvm normally, you won't get any error.

Solution 7 - node.js

For me, I didn't wanted to run cmd with administrator rights every time I needed to change node version so what I did was go to NVM installation folder on windows is located at C:\Users\<username>\appdata\Roaming\nvm and modified the Properties>Compatibility to Run as adminstrator and now when I run nvm on my not-running-as-administrator-cmd it will just prompt me to confirm if execute as administrator.

Solution 8 - node.js

  1. Execute terminal as admin
  2. Access the folder from terminal
  3. Use the same command for nvm, ex.: nvm use 14.19.1

Solution 9 - node.js

For those using nvm v1.1.8 in Windows, I tried to install nvm and open it in cmd as an administrator., it didn't help.

Try using nvm v1.1.7. It worked for me :)

https://github.com/coreybutler/nvm-windows/releases/download/1.1.7/nvm-setup.zip

Solution 10 - node.js

i have run command as a administrator it works

run cmd as administrator

and then after enter

nvm use 8.12.0/or your version which you desired to use

then it will work

Solution 11 - node.js

  1. Open command prompt
  2. Right click on command prompt item in toolbar
  3. then again right click on command prompt
  4. click on run as administrator
  5. then run nvm use VersionNumber enter image description here

Solution 12 - node.js

[2022 UPDATE]

I came across this problem multiple times. Trying to run it as administrator, but then get an Error 145, or struggling because my integrated terminal in VSCode is not running as administrator by default...

Here is an Easy fix, recommanded by the NVM Windows team in the Common Issues Page.

1- Create a folder at the root of your disk called "nvm4w" : C:/nvm4w

2- Go back to your nvm-setup.exe and run it (if you lost it, then go back to the NVM-Windows Releases and download the latest nvm-setup.zip file.

3- Then, when the installer ask you to "Select the folder in wich Setup should create the sumlink", select that "nvm4w" folder you just created.

After this, everything will be fine, the administrator privileges are not required anymore.

Solution 13 - node.js

Version 1.1.9 of NVM for Windows has an issue that causes this problem. The solution is to remove it and then install version 1.1.7 (without Administrator privileges) and then it should work just fine.

Solution 14 - node.js

none of the admin cmd run-s described above solved access denied issue. However I reinstalled nvm in a C:\NVM\nvm and made the nodejs folder to be C:\NVM\nodejs and it worked without any access elevation.

thanks @Daniel McMullen for the link to Wiki

Solution 15 - node.js

I was getting same issue. I wanted to install nvm s I deleted node js folder in program files and then installed nvm but instead of command I installed node js from installer which cause this issue. To use nvm we must delete previous node js installed so I uninstalled node js and nvm from control panel and then followed the following steps:

  1. Installed nvm
  2. install node js using command 'nvm install v8.12.0'
  3. nvm use 8.12.0

Solution 16 - node.js

I uninstalled NodeJS and also nvm from the my computer. And then redownloaded the nvm and installed the NVM and then by using this command I installed the specific NodeJS version npm install 16.x.x.

Solution 17 - node.js

I had installed the node version I wanted, but couldn't set it with nvm use [version] in Powershell. This worked for me:

  1. Download scoop and install sudo for Windows with it, using the instructions of the following link.
  2. Run sudo nvm use [version].

Solution 18 - node.js

Didn't find solution to my problem here, hence posting answer to this old question to benefit others.

I had installed node outside nvm without admin priviledges. In that case, no matter if you install or run nvm using admin priviledges, nvm use ____ will give access denied.

I uninstalled node manually, installed it from within nvm and then ran nvm use and it worked.

Solution 19 - node.js

I just downgraded my version of nodejs by using the "nvm use..." command, since I found using nodejs v17 was causing my issue. When I set my (Windows 10) machine to use nodejs v16.14.0 the problem went away. To downgrade versions, I did the following, because there can also be difficulty doing that: https://github.com/coreybutler/nvm-windows/issues/674#issuecomment-1050369304

Solution 20 - node.js

*Be carefull with Dev mode on

-- About Access Denied -- In this case, try with you Git Bash. Search your Git Bash > Open File Location > Right Click > Open Properties > Compatibility and check Run as Adminsitrator. Open Git Bash anywhere, type: nvm install version nvm list nvm use yourversion (ex. 17.99.99)

-- About NVM -v -- The command is: nvm version

I hope this solve your problem and others.

Solution 21 - node.js

It could be proxy issue. You can set the proxy url that npm already uses.

This is how you can find npm proxy config:

npm config list

Then set the same url for nvm:

nvm proxy "url"

Solution 22 - node.js

Run command prompt in administration

  1. install node version with nvm

    nvm install <node_version> (ex: nvm install 16.10.0)

  2. use installed node version

    nvm use <node_version> (example:- nvm use 16.10.0)

  3. check node version

    nvm list <node_version>


Or uninstall the previous nvm version and reinstall and do upper steps

Solution 23 - node.js

> "Elevation" refers "Windows Access Rights" by which Windows controls > what you can do on the file, specifically what folders you can read > and write to. You get them by using "Run As Administrator".

1. Enable Developer Mode

Settings -> Update & Security -> For Developers -> Activate Developer Mode

At this point, you will be able to use nvm without elevation.

2. Elevate nvm executable on demand

nvm root directory -> nvm.exe properties -> compatibility -> run this program as administrator -> apply

Whenever you need to use nvm, you will be prompted to grant elevation.

3. Run elevated command prompt

Press Windows + R, type cmd into the box and then press Ctrl + Shift + Enter.

Side note

I am not sure about this but I think you can use nvm 1.1.6 release without all that hassle.

Solution 24 - node.js

All you just need to run cmd as an Administrator

Solution 25 - node.js

just open cmd as administrator do the job

Solution 26 - node.js

It Solve my issue in windows

  • Remove node completely.
  • Install NVM
  • Open CMD as administrator
  • Install node specific version
  • switch on that version(nvm use yourversion)

Solution 27 - node.js

I was facing the same issue, running the terminal/cmd as administrator solved my problem.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDhruv SinghView Question on Stackoverflow
Solution 1 - node.jsmxroView Answer on Stackoverflow
Solution 2 - node.jsPercyPhamView Answer on Stackoverflow
Solution 3 - node.jsHelloWorldView Answer on Stackoverflow
Solution 4 - node.jsBamzerocksView Answer on Stackoverflow
Solution 5 - node.jsDaniel McMullenView Answer on Stackoverflow
Solution 6 - node.jsAlish MadhukarView Answer on Stackoverflow
Solution 7 - node.jsRogerIAmView Answer on Stackoverflow
Solution 8 - node.jsJuliancioView Answer on Stackoverflow
Solution 9 - node.jsdev1037View Answer on Stackoverflow
Solution 10 - node.jsArjun GhimireView Answer on Stackoverflow
Solution 11 - node.jsSagar MView Answer on Stackoverflow
Solution 12 - node.jsDonyView Answer on Stackoverflow
Solution 13 - node.jsDiogo EichertView Answer on Stackoverflow
Solution 14 - node.jsToshView Answer on Stackoverflow
Solution 15 - node.jsUmerView Answer on Stackoverflow
Solution 16 - node.jsMalik HaseebView Answer on Stackoverflow
Solution 17 - node.jscoder-bebopView Answer on Stackoverflow
Solution 18 - node.jsKCKView Answer on Stackoverflow
Solution 19 - node.jsAndrew J HanlonView Answer on Stackoverflow
Solution 20 - node.jsThiagoCSoaresView Answer on Stackoverflow
Solution 21 - node.jsAli CoskunView Answer on Stackoverflow
Solution 22 - node.jsTakesha KaluarachchiView Answer on Stackoverflow
Solution 23 - node.jsVibingCreatorView Answer on Stackoverflow
Solution 24 - node.jsAhmed SayedView Answer on Stackoverflow
Solution 25 - node.jsThibautView Answer on Stackoverflow
Solution 26 - node.jsShivam KumarView Answer on Stackoverflow
Solution 27 - node.jsSagar MehtaView Answer on Stackoverflow