When selecting a specific version of Node to use with NVM, you may encounter an error saying that Access is denied.
The error doesn’t give further detail as to why nvm use
command is denied:
$ nvm use 16.15.0
exit status 1: Access is denied
This is weird because installing Node versions with nvm install
runs fine on my computer.
If you see the same error, this is because the nvm use
command needs to create symlinks to create the right PATH to node in your system.
You need to grant your current user permission to create symlinks, which can be done in two ways.
The easiest way is to open your command line application as Administrator. That should immediately resolve the issue.
$ nvm use 16.15.0
Now using node v16.15.0 (64-bit)
Alternatively, you can also enable Developer Mode on Windows 10, which will grant the permission to create symlinks.
Navigate to Settings > Update & Security > For developers and turn Developer Mode on as shown below:
Enabling developer Mode requires administrator access, so the option might be disabled when you’re using a device owned by your company or client.
What’s more, the Developer Mode menu effect has been changed in the latest Windows 10 version.
In Windows 10 v10.0.19043, the Developer Mode setting is different than the screenshot above:
This version of Developer Mode only allows you to install apps from any source. It doesn’t grant you the elevated permission to create symlinks.
The Windows 11 version has the same Developer Mode option as the Windows 10 19043 above, so it’s won’t help resolve the issue at hand.
Conclusion
As stated in the repository, NVM for Windows requires an Admin shell to run smoothly.
Fortunately, you only need to run the Admin shell when switching the active Node version used by NVM.
When you need to change Node version frequently, you can open two shells to work effectively:
- An Admin shell to run
nvm use
commands - A regular user shell to run
npm
ornode
commands in your project
Now you’ve learned how to resolve NVM error: exit status 1: Access is denied
.
Nice work! 👍