Skip to content

nvm on Windows

Problem Statement

You're trying to install Node Version Manager (nvm) on Windows using a command from Unix/Linux documentation:

bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

This results in errors like:

text
The system cannot find the path specified.
curl: (23) Failure writing output to destination

The issue occurs because the standard nvm doesn't support Windows. This installation method uses Unix-specific tools (curl, bash) that aren't compatible with Windows command prompt. Trying to run Linux/macOS commands on Windows causes the "path not found" and output destination errors.

Solution: Use nvm-windows

For Windows, you need nvm-windows, a separate project that provides similar functionality. Follow this installation process:

Step 1: Uninstall Existing Node.js

  1. Go to Control Panel → Programs → Uninstall a program
  2. Uninstall all existing Node.js versions
  3. Delete any residual Node.js folders (typically in C:\Program Files\nodejs\)

WARNING

Skipping this step may cause conflicts between nvm-managed Node.js versions and your existing installation.

Step 2: Download nvm-windows Installer

  1. Visit the official nvm-windows releases page
  2. Download the latest nvm-setup.exe file

Step 3: Run the Installer

  1. Right-click nvm-setup.exe and select "Run as administrator"
  2. Accept the license agreement
  3. Set installation location (default C:\Users\<user>\AppData\Roaming\nvm is recommended)
  4. Specify Node.js symlink location (default C:\Program Files\nodejs)

Step 4: Verify Installation

Open a new command prompt and check the version:

cmd
nvm version

You should see your installed nvm-windows version (e.g. 1.1.12).

Basic Usage

After installation, manage Node.js versions with these commands:

cmd
:: Install a specific Node.js version
nvm install 18.18.2

:: Use a version
nvm use 18.18.2

:: Set default Node.js version
nvm use 20.11.1 --default

:: List installed versions
nvm list

:: List available remote versions
nvm list available

:: Uninstall a version
nvm uninstall 16.20.2

Common Issues

1. Access Denied Errors

Run all nvm commands in administrator command prompt:

  1. Search for "cmd"
  2. Right-click Command Prompt → "Run as administrator"

2. Command Not Recognized

After installation:

  1. Close ALL command prompt and terminal windows
  2. Open a new administrative terminal and try again

3. Node.js Not Working After Installation

Run this after nvm install:

cmd
nvm on

Best Practices

  • Always install Node.js via nvm install - not with standalone installers
  • Use LTS versions for production work: nvm install --lts
  • Use odd-numbered versions for testing new features
  • Set a default with nvm use <version> --default

Alternative Management Tools

  • nvs (Node Version Switcher): Cross-platform alternative
  • fnm (Fast Node Manager): Faster with Rust implementation
  • Volta: Version manager with direct project support

TIP

nvm-windows doesn't support shell commands like nvm run or nvm exec. Use explicit Node commands:

cmd
node app.js

Conclusion

For Windows environments, use nvm-windows (coreybutler/nvm-windows) instead of the Unix-only nvm-sh/nvm. Follow these key steps:

  1. Uninstall existing Node.js
  2. Download nvm-setup.exe from the official releases
  3. Install as administrator
  4. Verify with nvm version
  5. Install and manage Node.js versions through nvm commands

With nvm-windows, you can seamlessly switch between Node versions without reinstalling or manual path adjustments.