Install Node.js with Node Version Manager (aka NVM)

Node.js (opens in a new tab) is a powerful and popular open-source runtime environment that allows developers to execute JavaScript code outside of a web browser.

It's vast ecosystem of modules and libraries, make it versatile for a wide range of applications, including server-side web development, network applications, real-time chat applications, and more.

We'll use Node Version Manager (opens in a new tab) to install and manage Node.js for us. Let's get started:

Step 1: Install NVM

Let's download and install nvm

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

This will have installed nvm, but to get started using it in the terminal we're currently using we can source our zsh config with the following command

source ~/.zshrc

We now have nvm setup, and can install a Node.js version of our choosing.

Step 2: Install Node.js 22.x

At the time of writing, the latest LTS version is 22. We're going to use nvm now to get that installed:

nvm install 22

You should see the following output in your terminal:

Downloading and installing node v22.x.x...
Downloading https://nodejs.org/dist/v22.x.x/node-v22.x.x-linux-x64.tar.xz...
################################################################################################################# 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v22.x.x (npm v11.3.0)
Creating default alias: default -> 22 (-> v22.x.x)

Now, if you type node --version you will see something like v22.14.1 confirming it's setup and you're ready to start building web applications 🎉.