Install Node.js (versions 18, 20, 22) with NVM on Ubuntu 24.04

Published: 21 May 2024
on channel: Stateless Code
450
8

Due to its integration with browsers since the advent of the World Wide Web, JavaScript has been used on the vast majority of websites created. Node.js is an asynchronous event-driven JavaScript runtime that can be used for creating executable scripts, building web servers, or doing just about anything else you would want to do with a programming language.

In this video, we use a tool called Node Version Manager (NVM) to install three different versions of Node.js on a freshly installed Ubuntu 24.04 Linux operating system. In order to install NVM, we first need to install curl, a command-line tool for making network requests across a variety of protocols, including HTTP(S).

This video covers:
00:00:00 Introduction
00:01:01 Why use NVM?
00:01:45 Take a quick tour of the NVM GitHub repo README
00:02:03 Try to execute NVM install command in terminal. Curl not installed. Install that first
00:02:52 Hit the up key twice in the terminal to retry the previous install command. It now succeeds. Close and reopen the terminal. Check install by running `nvm -v`
00:03:34 Review the support schedule of Node.js (as-of May 2024)
00:04:22 Install node 18. (As the first version installed, this becomes the default.)
00:04:43 Install node 20.
00:05:13 Install node 22
00:05:24 Demonstrate how 18 is the default version
00:06:06 How to use `nvm use` to switch between versions
00:06:25 Make node 20 the default version with `nvm alias default 20`
00:06:59 What's next?



See other related StatelessCode videos:
- Codecast: Install NodeJS 14 Ubuntu 20.04 (2021)
- Codecast: Install NVM and Yarn in Ubuntu 20.04 (2021)

Featured Playlist:
- Getting Started with Rails 7 Playlist

Resources that we relied upon for this solution:
- Node.js main website
- Node.js releases page
- Node.js package manager instructions (you can choose your OS and preferred method)
- NVM GitHub Repo
- Curl website

This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.


Watch video Install Node.js (versions 18, 20, 22) with NVM on Ubuntu 24.04 online without registration, duration 08 minute 13 second in high hd quality. This video was added by user Stateless Code 21 May 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 450 once and liked it 8 people.