nvm is not recognized in PowerShell or Command Prompt on Windows
nvm is not recognizedShort answer
Windows cannot find nvm.exe, or finds a different Node.js first. Run nvm env in a new PowerShell window. If it fails, NVM for Windows is not installed or the PATH change has not reached this terminal. If it works but node is wrong, an official Node.js install is overriding it.
Fix it fast
1Find out which cause you have
Open a new PowerShell window (an old one keeps the old PATH) and ask NVM for Windows to describe itself. The result splits the causes below.
nvm env where.exe node2Match what you see, then jump to its fix
- 1
nvm env fails and no NVM folder exists. The original nvm from GitHub only supports macOS and Linux.NVM for Windows is not installed, or this is the wrong nvmFix - 2
nvm works, but where.exe node lists a Program Files\nodejs path before the NVM one, and nvm use does not change the version.An official Node.js install is first on PATHFix - 3
The installer ran with a UAC prompt, and the tool is not found in the normal user terminal.The Community Build was installed as AdministratorFix
- 1
What does the error look like?
nvm is not recognized'nvm' is not recognized as an internal or external command
Cause 1 of 3
NVM for Windows is not installed, or this is the wrong nvm
1Check
The NVM for Windows documentation says that nvm env on a machine with the tool shows its configuration, and that the original nvm is a different project that does not run on Windows.
nvm env
Get-Command nvm -ErrorAction SilentlyContinue2Fix
Install NVM for Windows from its project, as a normal user for the Community Build, then open a new terminal and install a Node.js version.
nvm install lts
nvm list installed3Verify
Both nvm and node answer in the new window.
nvm env
where.exe nodeConfirmed by docs.nvm-windows.com
Cause 2 of 3
An official Node.js install is first on PATH
1Check
The installer page states that the system PATH Node.js directory overrides the NVM user PATH, and that the Community installer cannot keep an official Node.js install next to it.
where.exe node2Fix
Remove the official Node.js from Windows Settings, Installed apps, then reinstall NVM for Windows. The installer can instead move the existing install into NVM with /OFFICIALNODE=adopt (or remove it with drop), as the installer page documents.
# re-run the NVM for Windows installer silently, adopting the existing Node.js
.\nvm-setup.exe /OFFICIALNODE=adopt3Verify
Open a new terminal. where.exe node now lists only the NVM location.
where.exe node
nvm list installedConfirmed by docs.nvm-windows.com
Cause 3 of 3
The Community Build was installed as Administrator
1Check
The installer page warns not to install the Community Build as Administrator. A machine-wide install is what the Certified MSI is for.
nvm env2Fix
Uninstall it, then run the Community installer as your normal user. Use the Certified MSI instead if you need a machine-wide install.
# run the installer from a normal (non-elevated) terminal
.\nvm-setup.exe3Verify
In a fresh non-elevated terminal, nvm env prints the configuration.
nvm envConfirmed by docs.nvm-windows.com
How do I stop it coming back?
- Uninstall the official Node.js before you install NVM for Windows.
- Always open a new terminal after installing, so it picks up the updated PATH.
- Run nvm doctor when something odd happens; it is part of the documented triage steps.
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.
Related fixes
Back end
Airflow SSHOperator stops a long script with SSH command timed out
airflow.exceptions.AirflowException: SSH command timed out
SSHOperator waits only 10 seconds for a command by default.
3 causes, each with a fixBack end
Android gets HTML instead of JSON from a PHP API
org.json.JSONException: Value <br of type java.lang.String cannot be converted to JSONObject
The response body is not JSON.
2 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 fix