Installing Latest NodeJS, NPX and NPM in Linux Print

  • NodeJS, NPM, NPX, Latest
  • 15

Nodejs is a lightweight and efficient JavaScript platform that is built based on Chrome’s V8 JavaScript engine and NPM is a default NodeJS package manager. It can be used to build scalable network applications.

Installing NodeJS 16.x in RHEL, CentOS and Fedora:

The latest version of Node.js and NPM is available from the official NodeSource Enterprise Linux repository. This repository is maintained by the Nodejs website. You will need to add it to your system to be able to install the latest Nodejs and NPM packages.

Run the following command as root or non-root to add the repository for Node.js 16.x.

Note: Check the Latest version of NodeJs

# curl -fsSL https://rpm.nodesource.com/setup_16.x | bash -

Using the following commands, you can now install Nodejs and NPM on your system:

# yum -y install nodejs
OR
# dnf -y install nodejs

Installing NodeJS 16.x in Debian, Ubuntu and Linux Mint

The latest version of Node.js and NPM Additionally, the official NodeSource Enterprise Linux repository, which is maintained by the Nodejs website, is also available, and you will need to add it to your system to install the latest Nodejs and NPM packages.

Using Ubuntu
$ curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
$ sudo apt-get install -y nodejs

 Using Debian, as root
$ curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
$ apt-get install -y nodejs

Verify Latest Nodejs and NPM in Linux

Here are the commands you can run to check the version of nodejs and NPM installed on your system:

On RHEL, CentOS, and Fedora
# node --version
# npm --version
On Debian, Ubuntu and Linux Mint
$ nodejs --version
$ npm --version


That is it, Nodejs and NPM are now installed and ready for use on your system.


Was this answer helpful?

« Back