Installation and version management
Below we will introduce how to install and manage Node.js from multiple channels:
Installation using the official installation package
Download the installation package for the corresponding operating system from the Node.js official website, and then follow the prompts to install it step by step.
It is recommended to download the LTS version, which is the long-term support version (Long-Term Support, LTS).
After installation, it can be used out of the box without configuring environment variables.
Install using NVM
NVM (Node Version Manager) is the most popular Node.js version management tool on the market. It can easily install, switch, and delete different versions of Node.js.
NVM was originally used more in Linux and macOS environments. NVM does not officially support Windows. Later, Corey Butler launched and open-sourced nvm-windows, which can easily use NVM in Windows environment.
Install NVM-Windows
First, download the nvm-windows installation package and unzip it to any directory.
Double-click the installation package, and the environment variables will be automatically configured during the installation process.
Common commands
Install the latest LTS version of Node.js:
nvm install latest
Install a specified version of Node.js:
nvm install 20
Switch to a specified version of Node.js:
nvm use 20
Delete a specified version of Node.js:
nvm uninstall 20
View installed Node.js versions:
nvm list
View the currently used Node.js version:
nvm current
For more commands, please use nvm --help
to view or refer to the official documentation.