Debian and Ubuntu based distributions
Including Linux Mint, Linux Mint Debian Edition (LMDE), elementary OS, bash on Windows and others.
Node.js is available from the NodeSource Debian and Ubuntu binary distributions repository (formerly Chris Lea’s Launchpad PPA). Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.
Using Package Manager
This is the most basic installation you need.
Fire up a terminal and copy the commands to install Node.js and npm.
sudo apt-get update sudo apt-get install nodejs
Downloading and Installing from NodeSource
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs
For installing Node.js 9.x
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash - sudo apt-get install -y nodejs
Node.js and npm packages are available in the Community Repository.
pacman -S nodejs npm
Enterprise Linux and Fedora
Including Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora.
Node.js is available from the NodeSource Enterprise Linux and Fedora binary distributions repository. Support for this repository, along with its scripts, can be found on GitHub at nodesource/distributions.
Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.
On RHEL, CentOS or Fedora, for Node.js v8 LTS:
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
OR For installing Node.js 9.x
curl --silent --location https://rpm.nodesource.com/setup_9.x | sudo bash -
and then install
sudo yum -y install nodejs
For more information on installing on Linux visit the Node.js official website