DEV Community

Cover image for Easily install and manage multiple Node.js versions using nvm-desktop
The1111mp
The1111mp

Posted on

Easily install and manage multiple Node.js versions using nvm-desktop

Introduction

As a front-end development engineer, we usually install Node.js by downloading the binary installation package from the official website. However, in actual development, it is inevitable that due to some compatibility issues, we need to install and switch to different versions of Node.js. If we still use this method, then It is undoubtedly very inconvenient to have to uninstall the existing version before installing the new version.

Today we will introduce a tool to install and manage multiple Node.js versions through visual interface operation: nvm-desktop (full name: Node Version Manager Desktop). Supports Windows and macOS, the code is completely open source and can be used with confidence.

Supports setting up and switching different versions of Node separately for different projects.

GitHub logo 1111mp / nvm-desktop

Node Version Manager Desktop - A desktop application to manage multiple active node.js versions.

nvm-desktop

nvm-desktop

A cross-platform Node.js version manager with both:

  • GUI app (nvm-desktop) for visual management
  • CLI tool (nvmd) for terminal workflows

Supports macOS, Windows, and Linux.

English | 简体中文

Screenshot

Why use it

  • Install and uninstall Node.js versions quickly
  • Switch global Node.js version with one command/click
  • Pin Node.js versions per project
  • Keep environments isolated across Node.js versions
  • Use GUI or CLI based on your workflow

Install

Download from releases:

After installation, ensure these are available in terminal:

nvmd -V
node -v
npm -v
Enter fullscreen mode Exit fullscreen mode

Core usage (CLI-first)

1) Install a Node.js version

nvmd install 20.18.0
Enter fullscreen mode Exit fullscreen mode

2) List installed versions

nvmd ls
Enter fullscreen mode Exit fullscreen mode

3) Switch global version

nvmd use 20.18.0
node -v
Enter fullscreen mode Exit fullscreen mode

4) Set version for current project

nvmd use 18.20.4 --project
node -v
Enter fullscreen mode Exit fullscreen mode

5) Check current version

nvmd current
Enter fullscreen mode Exit fullscreen mode

6) Uninstall a version

nvmd uninstall 16.20.2
Enter fullscreen mode Exit fullscreen mode

7) Find executable path

nvmd which node
nvmd
Enter fullscreen mode Exit fullscreen mode

Screenshot

Download and Install

Download

Download link: nvmd-desktop Download Page (GitHub release)

Release v2.6.0

Depending on the platform, download the latest version.

Install

After downloading the binary installer for the corresponding platform, double-click to install it.

Because the program is currently not signed with a certificate through an Apple developer account, a security prompt will appear when running on macOS:

"File/App is damaged and cannot be opened. You should move it to Trash."

"File/App is damaged and cannot be opened. You should move it to Trash." is a Mac error that can occur to various macOS versions, such as macOS Ventura/Monterey/Big Sur/Catalina, especially on M1 Macs. It usually happens on apps or files downloaded from the web, but it can also arise when opening apps downloaded from App Store.

You can check the nvm-desktop documentation or this article (Fix 'File/App is damaged and cannot be opened' on Mac) to allow the program to run.

On the Windows platform, you need to trust this software in the firewall.

Because the project code is completely open source, please feel free to run it. Or you can clone the code to local compile and install according to the tutorial in the documentation.

Start Using

Take the macOS platform as an example:

According to the wizard, the following commands need to be added to the system's ~/.bashrc, ~/.profile or ~/.zshrc files:

export NVMD_DIR="$HOME/.nvmd"
export PATH="$NVMD_DIR/bin:$PATH"
Enter fullscreen mode Exit fullscreen mode

Under Windows, no additional operations are required. After installation and operation, directly search for the specified Node.js version and click to download and install it.

Enter the main page:

Node.js supports the arm64 architecture of macOS starting from v16.0.0:

Set different Node.js versions for different projects:

Find the version you need to download and install:

You can check the download progress in real time or cancel the download.

After installation, click the Apply button to set it to the current Node.js version:

Check if it works by typing node --version & npm --version in the terminal.

Other Features

Command Tool

The nvmd allows you to quickly manage different versions of Node.js through the command line (nvmd does not provide the download and installation function of Node.js. If you need to download and install a new version of Node.js, please open the nvm-desktop application):

$ nvmd use 18.17.1
Now using node v18.17.1
$ node -v
v18.17.1
$ nvmd use v20.5.1 --project
Now using node v20.5.1
$ node -v
v20.5.1
$ nvmd ls
v20.6.1
v20.5.1 (currently)
v18.17.1
$ nvmd current
v20.5.1
Enter fullscreen mode Exit fullscreen mode

nvmd --help

nvmd (2.6.0)
command tools for nvm-desktop

Usage: nvmd [COMMAND]

Commands:
  current  Get the currently used version
  list     List the all installed versions of Node.js
  ls       List the all installed versions of Node.js
  use      Use the installed version of Node.js (default is global)
  which    Get the path to the executable to where Node.js was installed
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

Please download new version of Node.js in nvm-desktop.
Enter fullscreen mode Exit fullscreen mode

After you switch the Node.js version through the nvmd use command line, please click the refresh button to let nvm-desktop synchronize the latest data.

See this documentation for more details: command-tools-intro.

Set Node versions individually for projects

It does not rely on the functions and shell of the operating system, and perfectly supports switching different Node.js versions for the project, and there is no need to restart the terminal after switching.

Click the Add Project button, select the project directory, and then select the required version of Node.js (already installed) for the project.

After selecting a version, a .nvmdrc file will be added to the root directory of your project, containing the selected version number. nvm-desktop sets the version of Node.js for the terminal through this file. Open your terminal and go to the project directory, and run node --version to see if it works.

The globally set Node.js version is v20.6.1:

Set the v20.5.0 version for the project:

Check in the root directory of the project in the terminal:

Quickly manage Node.js versions through the system tray menu

Avoid frequently opening interface windows and quickly switch Node.js versions through menu bar options.

macOS:

Windows:

Synchronize the latest released Node.js version

Because all Node.js version information data will be cached by default, if you want to view the latest released Node.js version, click the Remote Refresh button to synchronize the latest data (You can view it through the official link:https://nodejs.org/dist/index.json):

Custom download mirror address

The default download mirror address is https://nodejs.org/dist. If the download speed is slow in your area, then you can change the download address that suits you to download quickly.

Change the installation path of Node.js

The default installation path is: $HOME/.nvmd/versions:

Multi-Language and Multi-Theme

Multi-language currently supports English and Simplified Chinese:

The theme currently supports three modes: follow system, light and dark:

Installed Interface

Quickly find the installed and currently used version of Node.js on the installed interface for easy management.

View the Node.js release log

By clicking the version number of Node.js on the main interface, you can jump to the officially released Changelog interface of the corresponding version (keep track of the trends of the new version at any time):

At Last

Hope you enjoy this project I shared. Thank you. 😃

Github link:

Download link:

Top comments (0)