Node.js is a cross-platform JavaScript environment that can be used for server-side scripting. Due to its non-blocking workflow, Node.js is popular among the web developers for building a dynamic web application. Node Package Manager also known as npm is the package manager for Node.js. It also serves as a command-line utility for interacting with the npm online repository for package installation, version management, and dependency management. It is important to have Node.js installed in order to use npm. Also, working with updated versions of Node.js and npm ensures better performance and added features.
At the time of writing, the Node.js version included in the Ubuntu 20.04 repositories is 10.19.0 which is the previous TLS version.
The installation is pretty straightforward. Run the following commands to update the package index and install Node.js and npm:
sudo apt update sudo apt install nodejs npm
Once done, verify the installation by running:
Npm --version
nodejs --version