Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Node.js, PHP and APIs

nvm is not recognized in PowerShell or Command Prompt on Windows

Errornvm is not recognized

Short 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.

  • Applies to NVM for Windows Community Build, Windows 11, PowerShell 7
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 node
  2. 2Match what you see, then jump to its fix

    1. 1nvm 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. 2nvm 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. 3The installer ran with a UAC prompt, and the tool is not found in the normal user terminal.The Community Build was installed as AdministratorFix

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 SilentlyContinue

2Fix

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 installed

3Verify

Both nvm and node answer in the new window.

nvm env
where.exe node

Confirmed by docs.nvm-windows.com

Did this fix it?

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 node

2Fix

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=adopt

3Verify

Open a new terminal. where.exe node now lists only the NVM location.

where.exe node
nvm list installed

Confirmed by docs.nvm-windows.com

Did this fix it?

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 env

2Fix

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.exe

3Verify

In a fresh non-elevated terminal, nvm env prints the configuration.

nvm env

Confirmed by docs.nvm-windows.com

Did this fix it?

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

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 fix

Back 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

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.