Skip to content

Instantly share code, notes, and snippets.

@teocci
Created October 27, 2022 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teocci/e5c938aa4be672504934270b36862dc4 to your computer and use it in GitHub Desktop.
Save teocci/e5c938aa4be672504934270b36862dc4 to your computer and use it in GitHub Desktop.

How to install Node.js 19 on Ubuntu 20.04 LTS

First and foremost, it’s always good to make sure your system is up date to date, rebooting it if necessary:

sudo apt update
sudo apt upgrade

We expects curl to already be installed as well:

sudo apt install -y curl

This guide also makes reference of sudo, which you may not have available if you’re running inside of a Docker container. If that’s the case, just omit the sudo commands and you should be just find.

With everything up to date and the necessary dependencies installed, we can fetch the Node.js 19.x installation script with curl and run it:

curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash -

This script will do all of the necessary work to add the new apt source and run an apt update to get things primed and ready.

What it doesn’t do, is actually installed the nodejs package for you, so you’ll also need to run:

sudo apt install -y nodejs

And once that’s finished running, we can check that we are in fact running the latest and greatest version of Node.js:

$ node --version
v19.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment