❤️ AZDIGI has officially updated to a new blog system. However, some posts may have incorrect or mismatched images. Please click the Report article button at the bottom of the post so AZDIGI can update as quickly as possible. Thank you!

Installing Node.js with NVM on Ubuntu 22.04 with 2 steps.

Introduction

Node.js is a software system designed for writing scalable internet applications, especially web servers. The program is written in JavaScript, using event-driven, asynchronous input/output to minimize overhead and maximize scalability. Node.js includes Google’s V8 JavaScript engine, libUV and several other libraries. Node.js was created by Ryan Dahl in 2009 and developed under the umbrella of Joyent.

NVM is an acronym for Node.js Version Manager, a flexible tool for installing and managing multiple versions of Node.js and related packages simultaneously.

In this tutorial, we will learn how to install a specific version of Node.js through NVM, please see the installation section below.

Implementation Guide

Step 1: Install NVM

To install or update NVM, you can use the curl command to download and execute the file. You can download the latest version from the nvm official repository

  • Download the installation file
AZDIGI Tutorial
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
    
  • Run the install command
AZDIGI Tutorial
source ~/.bashrc
    
  • To check if NVM has been installed successfully, please run the following command:
AZDIGI Tutorial
command -v nvm
    
  • To check if NVM has been installed successfully, please run the following command:
How to install Node.js with NVM on Ubuntu 22.04

Step 2: Install Node.js

  • Once you’ve installed NVM, you can list all the Node.js versions available through NVM using ls-remote with the following command:
AZDIGI Tutorial
nvm ls-remote
    
  • After running the above command, the system will display a list of Node.js versions. You can install any of the versions shown here.
How to install Node.js with NVM on Ubuntu 22.04

For example, if you want to install Node.js version 16.15.0, you can simply use the install command as follows:

AZDIGI Tutorial
nvm install v16.15.0
    
How to install Node.js with NVM on Ubuntu 22.04
  • Check the results after installation
AZDIGI Tutorial
node -v
    
How to install Node.js with NVM on Ubuntu 22.04

Above are the steps to install Node.js through NVM in the most detail. With NVM, you can easily manage and install different versions of Node.js straightforwardly. Wishing you success!

You can refer to other instructions at the link below:

If you need support, you can contact support in the ways below:

Share:
This article has been reviewed by AZDIGI Team

About the author

Thạch Phạm

Thạch Phạm

Đồng sáng lập và Giám đốc điều hành của AZDIGI. Có hơn 15 năm kinh nghiệm trong phổ biến kiến thức liên quan đến WordPress tại thachpham.com, phát triển website và phát triển hệ thống.

10+ years serving 80,000+ customers

Start your web project with AZDIGI