How to Install Node.js LTS on Ubuntu
Node.js is a runtime JavaScript platform built on top of the V8 JavaScript engine, where Node.js can execute JavaScript on the server (server-side). Node.js was developed by Ryan Dahl and released for the first time on May 27, 2009.
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.
1 | curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash - |
Install the nodejs package.
1 | 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.
1 2 3 | $ node -v v14.15.0 |
Check the npm version.
1 2 3 | $ npm -v 6.14.8 |
If you found this article helpful and would like to support my work, consider making a donation through PayPal. Your support helps me continue creating useful content and tutorials. Thank you!
Donate via PayPal: https://paypal.me/musaamin