nvm-windows: exit status 1: Access is denied

Issue: i get access is denied when i try to use specific version of node

How To Reproduce: i installed 2 version node 14 and node 16 when trying to use node version 14 by typing nvm use 14.18.2 i get this error same error happens when using v16

Expected Behavior: It should use node version i choose to use

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 17 (3 by maintainers)

Most upvoted comments

@CASPERg267 try to open the CMD as administrator

Please update the guide:

Checklist before installing nvm-windows

  • Developer mode on Windows: on
  • Uninstall all previous versions of nodejs and nvm.
  • Create the following folder structure:

– c:\nvm4w – c:\nvm4w\nodejs – c:\nvm4w\nvm

  • Make them all write enabled (right click the folder, check properties, see that Read only is not marked at all)

Run the installer as an administrator.

  • When prompted, use your folders instead of the ones suggested by default in the installer.
  • Once finished, close any terminal, cmd or PowerShell window where you intend to use nvm, and
  • Open a new one.

Test everything is ok

  • Run nvm --version to check if it’s installed correctly.
  • Run nvm root to verify that your settings have been applied correctly.

Run it

  • Run nvm install <the version you want>
  • When finished, run nvm use <the version you want>

Even then, not everyone has administrative rights to the computer (some of us work with impossed restrictive policies) and as of testing it today with developer mode activated, this no longer works as intended (i.e. I have developer mode active, yet I get access denied when issuing an nvm use command).

curious that this has only become an issue lately…what has changed?

Ideally this would be addressed with a UAC dialog for those of who have local admin privileges but are not able to enable a Developer mode (likely due to running on an older version of Win10 or due to being locked out because of group policy restrictions).

Would you be willing to add the option to configure nvm to enable this alternative approach?

@coreybutler To reduce the number of people having this confusing problem, it might be a good idea to modify NVM4W to check whether it has administrative permissions proactively at launch, and display a meaningful warning. Or even link to the relevant README. I’ve found that it’s possible to get into some quite odd states because some NVM4W commands work without admin permissions but some do not.

same issue here 😦

@terryjiang2020 has correctly cited that Windows protects some directories, even if you have developer mode enabled.

Per the suggestion, I’ve added the following change to the wiki:

image

Can confirm that even with developer mode enabled, the access denied error still happens. Windows 10, 20H2, build 19042.1645.

Can also confirm that I can create symbolic links manually from a non-administrator powershell session: image