Installing Multiple Versions of Node.js Using NVM

node version manager

Introduction

Node Version Manager (NVM) is a powerful tool for managing multiple Node.js versions on your machine. However, NVM works differently on Windows (using nvm-windows) compared to macOS/Linux (using nvm-sh). This guide separates the setup, usage, and troubleshooting for each platform, with examples to help you get started. Whether you’re on Windows or a Unix-based system, you’ll learn how to install NVM and manage Node.js versions.

NVM on Windows (nvm-windows)

nvm-windows is a separate project designed for Windows, as the original NVM is POSIX-compliant and not supported on Windows. It provides similar functionality but uses different commands and installation steps.

Installation

1. Download nvm-windows:

  • Visit the nvm-windows GitHub releases page.
  • Download the latest nvm-setup.exe (e.g., version 1.1.12 as of July 2025).
  • Run the installer as an administrator (right-click → “Run as administrator”).

2. Verify Installation: Open Command Prompt or PowerShell (preferably as administrator) and run:

Run as administrator 
Expected Output: 1.1.12 (or the installed version).

3. Enable nvm-windows (if needed): Ensure nvm is enabled:

Enable nvm-windows 

Key Commands

1. List Available Versions: Use nvm list available

List Available Versions 

Expected Output:

Expected Output  

2. Install a Node.js Version: To install Node.js 18.20.4:

Install a Node.js Version 

Verify:

nvmOutput: v18.20.4 

4. List Installed Versions:

List Installed Versions  

Output:

Output  

5. Uninstall a Version:

Uninstall a Version  

NVM on macOS/Linux (nvm-sh)

nvm-sh is the original NVM, designed for POSIX-compliant systems like macOS and Linux.

Installation

1. Install NVM: Run in your terminal:  

NVM on macOS/Linux (nvm-sh)  
This installs NVM version 0.40.1 (latest as of July 2025). Check the nvm-sh GitHub page for updates.

2. Update Shell: Add NVM to your shell profile (e.g., ~/.bashrc, ~/.zshrc):

This installs NVM version 0.40.1  

Or for Zsh:

nvm version 

3. Verify Installation:

Verify Installation   
Output: 0.40.1

Key Commands

1. List Available Versions:

Output: 0.40.1  

Output:

Output:  

Filter specific versions:

Filter specific versions:  

2. Install a Node.js Version:

Install a Node.js Version  

3. Switch Versions:

Switch Versions 

Verify:

nvm version  
Output: v18.20.4

4. Set Default Version:

Set Default Version   

5. List Installed Versions:

List Installed Versions  

Output:

Output  

6. Uninstall a Version:

Uninstall a Version  

Conclusion

Node Version Manager (NVM) is an essential tool for developers juggling multiple Node.js versions, whether on Windows (using nvm-windows) or macOS/Linux (using nvm-sh). By allowing seamless installation, switching, and management of Node.js versions, NVM eliminates version conflicts and simplifies project setup. On Windows, nvm list available helps you explore versions, while nvm ls-remote does the same on macOS/Linux.

If you found this helpful, feel free to share or drop a comment. Happy coding with Laravel! 🧱✨