Reference - https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-22-04

There are a few ways you can install Node.js

  1. Build it from Source (difficult, not recommended)
  2. Use a package manager like brew , snap etc
  3. Use nvm (Node Version Manager)

Node version manager

NVM is a cli (Command line interface) that lets you install/upgrade the version of Node.js you have locally.

nvm install v22