Node.js is available in 2 release versions, LTS (Long Term Support) for long-term support, can get updates for up to 3 years, and the standard release version only gets updates for up to 8 months.
Install Node.js LTS
Node.js can be installed in several ways, here using the .deb binary distributions for the Linux distro Ubuntu or Debian.
Node.js is available in the default Ubuntu repository, but the version can be an old version or not an LTS version.
Add the Node.js LTS repository to install the LTS version of Node.js.
curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
Install the nodejs package.
sudo apt install -y nodejs
The installed LTS version is the latest LTS version. For example, there are currently 2 active LTS versions, 12 LTS and 14 LTS versions, so what is installed is Node.js 14 LTS.
Verify that Node.js is installed by displaying the release version of node and npm.
Check the node version.
$ node -v
Check the npm version.
$ npm -v
If you enjoy what I do, please support me on Ko-fi! https://ko-fi.com/musaamin