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:
3. Enable nvm-windows (if needed): Ensure nvm is enabled:
Key Commands
1. List Available Versions: Use nvm list available
Expected Output:
2. Install a Node.js Version: To install Node.js 18.20.4:
Verify:
4. List Installed Versions:
Output:
5. 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:
2. Update Shell: Add NVM to your shell profile (e.g., ~/.bashrc, ~/.zshrc):
Or for Zsh:
3. Verify Installation:
Key Commands
1. List Available Versions:
Output:
Filter specific versions:
2. Install a Node.js Version:
3. Switch Versions:
Verify:
4. Set Default Version:
5. List Installed Versions:
Output:
6. 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! 🧱✨
Social Plugin