NVM Installed: Managing and Switching Node.js Versions
Node Version Manager (NVM) is a command-line tool that allows you to install, list, and switch between different versions of Node.js on your operating system. It’s perfect for developers who maintain multiple projects requiring different Node versions.
If you’ve ever seen the message “NVM installed”, this guide will show you how to use NVM effectively — including commands like nvm install latest, nvm ls remote, and nvm alias default.
1. Check Installed Node Versions
To see which Node.js versions are installed on your system, use the command:
This will display a list of Node.js versions, marking the default and currently active one.
You can also view all remote versions available for installation:
This command retrieves all versions directly from the Node.js servers.
2. Install a New Node.js Version
To install a specific Node.js version, use the command:
For example, to install Node.js v18.20.4:
To install the latest LTS version automatically, simply run:
Or to get the latest available version overall:
These commands download and set up the specified version globally within NVM’s environment.
3. Switch Between Node Versions
Once multiple versions are installed, switch between them easily:
Example:
This activates Node.js version 20.17.0 for your current terminal session.
If you want to confirm which version is active, run:
4. Set a Default Node.js Version
To make a specific Node.js version the default every time you open a new terminal, use:
Example:
Now, each new session will automatically use that version unless overridden.
5. Uninstall a Node Version
If you want to remove an older version, you can do so easily:
Example:
This will delete the specified version from your system while leaving other installations intact.
6. Common NVM Commands Overview
| Command | Description | 
|---|---|
| nvm install latest | Installs the most recent Node.js version | 
| nvm install --lts | Installs the latest LTS release | 
| nvm ls | Lists all Node.js versions installed locally | 
| nvm ls-remote | Lists all Node.js versions available remotely | 
| nvm alias default | Sets a default Node version for all sessions | 
| nvm uninstall | Uninstalls a specific version of Node.js | 
| nvm current | Displays the currently active version | 
7. Troubleshooting and Tips
- Always run NVM commands from your command line or terminal, not from scripts that bypass shell configuration.
-  If NVM seems not to work after installation, ensure your shell profile (like .bashrcor.zshrc) includes the NVM initialization line.
- You can verify NVM installation with:
If it returns nvm, the tool is correctly installed.
8. Why Use NVM?
Using NVM helps you:
- Test your apps on multiple Node.js versions.
- Prevent dependency conflicts across projects.
- Simplify team collaboration when using different Node environments.
It works on macOS, Linux, and Windows (via WSL), giving you a unified way to manage Node.js version numbers across your operating systems.