Table of Contents
- What is Nodejs
- Advantages of NVM
- Download and install nvm
- Restart your terminal (On Mac ZSH)
- Let's check if the installation was successful
- Show all remotely available versions of node
- List Node Versions with NVM
- Daily commands
- Use NVM to Install the Latest LTS Node.js Release
- Last but not least - NVM Uninstall Steps
The Node Version Manager (NVM) is an open-source version manager for Node.js (Node). NVM is easy to understand and works on any POSIX-compliant shell (e.g. sh or bash). NVM allows you to easily install and manage different versions of Node and switch between them on a per-shell basis. This guide describes how to install NVM, and how to use it to install and run different versions of Node.
What is Nodejs
Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that executes JavaScript code outside a web browser. More Details can be found on our overview page.
Advantages of NVM
Because Node changes quickly, testing applications with different versions is often difficult. Next.js 14 for instance requires Node 18.17.0 etc. Since NVM enables quick and effortless switching between Node versions, it is much easier to test version compatibility and upgrades with multiple libraries. NVM also simplifies the installation and compilation process. If you're using Windows I recommend this Windows-specific version of nvm.
Download and install nvm
or use wget if you like it more
This script clones the nvm repository into ~/.nvm. Then it updates your profile (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc) to source the nvm.sh it contains
With the command
you should see this
Restart your terminal (On Mac ZSH)
Let's check if the installation was successful
Show all remotely available versions of node
List Node Versions with NVM
Review all installed versions of Node with the ls command:
Daily commands
Use NVM to Install the Latest LTS Node.js Release
Any Node.js version can be in one of the following three release phases: Current, Long Term Support (LTS), and Maintenance. The LTS release includes new features, bug fixes, and updates that have been approved.
Use the following command to install the latest LTS version of Node.js on your systemLast but not least - NVM Uninstall Steps
If you no longer intend to use NVM, uninstall it with the unload command.
First, deactivate NVM with the nvm deactivate command to clear any path variables Next, use the unload command to uninstall NVMHere you can find all NVM-related posts
Here you can find additional information regarding NVM on nodejs.org