Installing the latest version of node using nvm:

Install the latest nvm through its Github repo:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

source ~/.bashrc

check the latest version of node and select it:

nvm list-remote

Out:

...
       v20.15.0   (LTS: Iron)
       v20.15.1   (LTS: Iron)
       v20.16.0   (Latest LTS: Iron)
        v21.0.0
        v21.1.0
        v21.2.0
        v21.3.0
        v21.4.0
        v21.5.0
        v21.6.0
        v21.6.1
        v21.6.2
        v21.7.0
        v21.7.1
        v21.7.2
        v21.7.3
        v22.0.0
        v22.1.0
        v22.2.0
        v22.3.0
        v22.4.0
        v22.4.1
        v22.5.0
        v22.5.1
        v22.6.0

Install the desired version of node:

nvm install v20.16.0
Answer from Benyamin Jafari on askubuntu.com
🌐
GitHub
github.com › nvm-sh › nvm
GitHub - nvm-sh/nvm: Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
# Use bash for the shell SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Create a script file sourced by both interactive and non-interactive bash shells ENV BASH_ENV /home/user/.bash_env RUN touch "${BASH_ENV}" RUN echo '. "${BASH_ENV}"' >> ~/.bashrc # Download and install nvm RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | PROFILE="${BASH_ENV}" bash RUN echo node > .nvmrc RUN nvm install · More robust, works in CI/CD-Jobs. Can be run in interactive and non-interactive containers. See #3531. FROM ubuntu:latest ARG NODE_VERSION=20 # install curl RUN apt update &&
Starred by 90.3K users
Forked by 9.7K users
Languages   Shell 98.0% | Makefile 1.2%
🌐
GeeksforGeeks
geeksforgeeks.org › linux-unix › how-to-install-nvm-on-ubuntu-22-04
How to Install NVM on Ubuntu 22.04 - GeeksforGeeks
July 23, 2025 - Installing the NVM on Ubuntu 22.04 is allows us to easily manage multiple versions of Node.js on the system which provides the flexibility and convenience for to your development projects. By following the steps outlined in this guide, you should be able to install NVM, verify the installation, install Node.js versions, and switch between them effortlessly.
Discussions

How to install Ubuntu on an NVMe RAID
Try doing btrfs then you can add the other drives later on and make it a raid 0. You can also do this with zfs. The installer for debian and some other distros are better for doing root on mdadm. More on reddit.com
🌐 r/buildapc
3
15
November 19, 2019
Install Ubuntu Server 20 on NVMe M.2 Dell Precision T5610

You need to install the boot blocks and /boot on a non PCIe device so the bios can see them. Once the kernel boots it can then mount the NVMe SSD as root...

More on reddit.com
🌐 r/homelab
4
2
December 3, 2018
How to Install NVM on Linux or Ubuntu?

Why would I read an article when the instructions on how to do this is in the NVM documentation?

More on reddit.com
🌐 r/node
1
0
February 5, 2020
[Ubuntu] How to install a newer version of Node than the one provided by apt?
Nvm solves all my issues with version swapping More on reddit.com
🌐 r/node
13
12
April 17, 2022
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-node-js-on-ubuntu-22-04
How to Install Node.js on Ubuntu (Step-by-Step Guide) | DigitalOcean
May 28, 2025 - This method provides newer versions than the default Ubuntu repositories and integrates with the system’s package manager. For managing multiple Node.js versions (Ideal for developers): Node Version Manager (NVM) is highly recommended. It allows you to install, switch between, and manage multiple Node.js versions on the same system without conflicts.
🌐
Linode
linode.com › docs › guides › how-to-install-use-node-version-manager-nvm
How to Install and Use NVM (Node Version Manager) | Linode Docs
November 29, 2023 - These instructions cover how to install NVM. While these are generally valid for most Linux distributions, some of the .bashrc directives might vary slightly on different shells. You can install and use NVM regardless of whether you have already installed Node.
🌐
Medium
medium.com › @fieryphoenixtech › installing-nvm-on-ubuntu-basic-node-version-control-14fd00c673c4
Installing NVM on Ubuntu & Basic Node Version Control | by PhoenixIgnited.Tech | Medium
November 21, 2024 - Usage: nvm --help Show this message --no-colors Suppress colored output nvm --version Print out the installed version of nvm nvm install [<version>] Download and install a <version>. Uses .nvmrc if available and version is omitted.
Find elsewhere
🌐
TecAdmin
tecadmin.net › how-to-install-nvm-on-ubuntu-20-04
How To Install NVM on Ubuntu 20.04 – TecAdmin
April 26, 2025 - In this guide, we will show you step-by-step how to install NVM on Ubuntu 20.04. We will also explain how to use it to install and manage different versions of Node.js.
🌐
4Geeks
4geeks.com › how-to › install-nvm-linux
How to Install NVM on Linux (Ubuntu and Centos)
July 15, 2025 - Learn how to install NVM on Linux with our easy-to-follow guide. Covering popular distributions like Ubuntu and Fedora, this article includes troubleshooting...
🌐
AlexHost
alexhost.com › home › faq или база знаний › how to install nvm for node.js on ubuntu
How to Install NVM for Node.js on Ubuntu ⋆ ALexHost SRL
February 12, 2025 - Open a terminal and run: ... This command ensures that all your package lists are up to date. To install NVM, you need to download the installation script from the official NVM repository.
🌐
npm
docs.npmjs.com › downloading-and-installing-node-js-and-npm
Downloading and installing Node.js and npm | npm Docs
To publish and install packages to and from the public npm registry or a private npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. We strongly recommend using a Node version manager like nvm to install Node.js and npm.
🌐
Ava
ava.hosting › home › faq › how to install nvm for node.js on ubuntu
How to Install NVM for Node.js on Ubuntu ⋆ AVA.HOSTING
March 26, 2025 - This guide will walk you through the steps to install NVM on your Ubuntu system.
🌐
Liquid Web
liquidweb.com › home › how to install node.js on ubuntu 22.04 via nvm
How to Install Node.js on Ubuntu 22.04 via NVM | Liquid Web
February 19, 2025 - You have an Ubuntu 22.04 server ready for use. The steps in this post were tested on a fresh cloud server. You have a regular, non-root user with sudo privileges set up on your server. Do not run the NVM install scripts as root or with sudo. NVM manages Node.js versions per user.
🌐
Node.js
nodejs.org › en › download
Node.js — Download Node.js®
Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-node-js-on-ubuntu-20-04
How to Install Node.js on Ubuntu | DigitalOcean
May 2, 2025 - Learn how to install Node.js on Ubuntu using apt, NodeSource, and NVM. Choose the best method for your needs with this beginner-friendly guide
🌐
GitHub
gist.github.com › marcusholloway17 › ef098e7a871b4f1e6d5ddef183f5260b
How To Install NVM on Ubuntu 22.04 · GitHub
You must have a running Ubuntu 22.04 Linux system with shell access. Log in with a user account to which you need to install node.js. ... The nvm installer script creates an environment entry to the login script of the current user.
🌐
Microsoft Learn
learn.microsoft.com › en-us › windows › dev-environment › javascript › nodejs-on-wsl
Install Node.js on Windows Subsystem for Linux (WSL2)
For more information, see the GitHub project page for the latest release information on NVM. To verify installation, enter: command -v nvm ...this should return 'nvm', if you receive 'command not found' or no response at all, close your current terminal, reopen it, and try again.
🌐
MonoVM
monovm.com › 🐧 linux 🐧 › how to install nvm on ubuntu: step-by-step guide
How to Install NVM on Ubuntu: Step-by-Step Guide
February 13, 2024 - Package Manager (apt): Verify that the apt package manager is installed on your Ubuntu system. This package manager is essential for fetching and managing software packages. Curl Installed: Confirm the presence of the curl command-line tool. If not installed, you can acquire it via the package manager by executing sudo apt install curl. Root or Sudo Access: Ensure you possess administrative privileges or sudo access to execute privileged commands required for installation and setup. To install Node Version Manager (NVM) on Ubuntu and manage multiple Node.js versions, follow these steps:
🌐
freeCodeCamp
freecodecamp.org › news › node-version-manager-nvm-install-guide
Node Version Manager – NVM Install Guide
September 9, 2022 - By Dillion Megida In this article, I'll explain how you can install NVM, or Node Version Manager, on Windows, Linux, and Mac. What is NVM? Node Version Manager (NVM), as the name implies, is a tool for managing Node versions on your device. Differen...