NVM for Windows says access denied when you install or switch Node.js
Access DeniedShort answer
NVM for Windows switches versions with a symlink, and Windows usually needs administrator rights to create one. Run PowerShell or Command Prompt as Administrator first. If it still fails, the symlink folder may already be a real directory, or an older Node.js install is in the way.
Fix it fast
1Find out which cause you have
Open a new shell with Administrator rights and run the debug command. NVM for Windows 1.1.11 and later has it, and it reports PATH conflicts.
nvm debug2Match what you see, then jump to its fix
- 1
Access denied right after nvm install or nvm use in a normal windowThe shell is not running as AdministratorFix - 2
nvm use fails even in an Administrator shell, and the symlink path exists as a normal directoryThe symlink location is already a real folderFix - 3
nvm use finishes, but node -v shows another version, or nothing changesA separate Node.js installation still owns the PATHFix - 4
Access denied or exit 5 although the shell is elevated, with the nvm root under C:\Program Files; or exit 145 or exit 32 with 'being used by another process'Node.js versions are stored in a protected folder or a locked directoryFix
- 1
What does the error look like?
Access Deniedexit 5exit 1
Cause 1 of 4
The shell is not running as Administrator
1Check
NVM for Windows documents that it runs in an Admin shell, because Windows normally needs administrative rights to create the symlink that nvm use relies on.
([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)2Fix
Close the window and start PowerShell or Command Prompt with Run as administrator, then repeat the command.
nvm use 22.11.03Verify
node reports the version you asked for.
node -vConfirmed by github.com
Cause 2 of 4
The symlink location is already a real folder
1Check
NVM for Windows documents that setting the symlink location to an existing directory fails, because a symlink cannot overwrite a physical directory. An earlier manual Node.js install in that path does this.
Get-Item "C:\path\to\your\symlink-folder" | Select-Object FullName, LinkType
echo $env:NVM_SYMLINK2Fix
If LinkType is empty, the folder is a real directory. Uninstall the Node.js that created it, or point NVM_SYMLINK at a path that does not exist yet, then run nvm use again.
nvm use 22.11.03Verify
The same folder now shows a link.
Get-Item "C:\path\to\your\symlink-folder" | Select-Object LinkType, TargetConfirmed by github.com
Cause 3 of 4
A separate Node.js installation still owns the PATH
1Check
The project recommends uninstalling existing Node.js versions before using NVM for Windows. When another install sits earlier in PATH, nvm use can appear to do nothing.
where.exe node
nvm debug2Fix
Uninstall the standalone Node.js from Windows Apps, open a new Administrator shell, and select a version again.
nvm list
nvm use 22.11.03Verify
where.exe lists only the NVM symlink path for node.
where.exe node
node -vConfirmed by github.com
Cause 4 of 4
Node.js versions are stored in a protected folder or a locked directory
1Check
Windows requires administrator rights to write to C:\Program Files. A different failure, exit 145 or 32, appears when a terminal or Explorer window has the version folder open or a node.exe process is still running.
nvm root
Get-Process node -ErrorAction SilentlyContinue2Fix
Keep the Node.js versions in an unprotected folder such as C:\nvm4w, and run nvm use from a neutral directory such as C:\ after stopping running Node processes.
cd C:\
Stop-Process -Name node -ErrorAction SilentlyContinue
nvm use 22.11.03Verify
nvm use completes with no error.
node -vConfirmed by github.com
How do I stop it coming back?
- Keep an Administrator terminal profile just for nvm commands.
- Uninstall any standalone Node.js installer before installing NVM for Windows.
- Choose a symlink folder that does not exist when you install NVM for Windows.
- Run it from CMD or PowerShell; the project notes that some other shells ignore the administrator prompt.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Back end
nvm is not recognized in PowerShell or Command Prompt on Windows
'nvm' is not recognized as an internal or external command
Windows cannot find nvm.exe, or finds a different Node.js first.
3 causes, each with a fixBack end
ng serve says it cannot determine the project or target
Cannot determine project for command.
The Angular CLI looked through angular.json for a project that defines the target you asked for (serve, build, test) and found none, or found several and could not pick one.
3 causes, each with a fixBack end
ng fails with Cannot find module @angular/cli/bin/ng
Cannot find module '@angular/cli/bin/ng'
The ng command is the entry point to the Angular CLI package.
2 causes, each with a fixBack end
Angular app shows 'Cannot GET /' when served by a Node.js server
Cannot GET /dashboard
Cannot GET / is Express saying no route or file matches the request.
3 causes, each with a fixBack end
ng serve cannot find the dev-server builder package
Could not find the implementation for builder @angular/build:dev-server
The builder named in angular.json (for example @angular-devkit/build-angular:dev-server) is looked up as an npm package starting from the workspace root.
3 causes, each with a fixBack end
Angular build says it cannot resolve '@angular/localize/init'
Can't resolve '@angular/localize/init' in '/usr/src/app/src'
The build imports @angular/localize, and that package is not in node_modules.
2 causes, each with a fix