Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Latest NodeJS and NPM in Linux - DesignLinux

Jun 23 2020
designlinux 0 Comments

In this guide, we shall take a look at how you can install the latest version of Nodejs and NPM in RHEL, CentOS, Fedora, Debian, and Ubuntu distributions.

Read Also: NVM – Install and Manage Multiple Node.js Versions in Linux

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. You can use it to build scalable network applications.

On this page:
  1. How to Install Node.js 14 in CentOS, RHEL, and Fedora
  2. How to Install Node.js 14 in Debian, Ubuntu and Linux Mint

How to Install Node.js 14 in CentOS, RHEL, and Fedora

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

Important: If you are running an older release of RHEL 6 or CentOS 6, you might want to read about running Node.js on older distros.

Installing NodeJS 14.x in RHEL, CentOS and Fedora

To add the repository for the latest version of Node.js 14.x, use the following command as root or non-root.

-------------- As root user -------------- 
# curl -sL https://rpm.nodesource.com/setup_14.x | bash -

-------------- A user with root privileges  --------------
$ curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -

Installing NodeJS 12.x on RHEL, CentOS and Fedora

If you want to install NodeJS 12.x, add the following repository.

-------------- As root user -------------- 
# curl -sL https://rpm.nodesource.com/setup_12.x | bash -

-------------- A user with root privileges  --------------
$ curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -

Installing NodeJS 10.x on RHEL, CentOS and Fedora

If you want to install NodeJS 10.x, add the following repository.

-------------- As root user -------------- 
# curl -sL https://rpm.nodesource.com/setup_10.x | bash -

-------------- A user with root privileges  --------------
$ curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
Adding Node.js Repository in CentOS

Adding Node.js Repository in CentOS

Next, you can now install Nodejs and NPM on your system using the command below:

# yum -y install nodejs
OR
# dnf -y install nodejs
Install NodeJS in CentOS

Install NodeJS in CentOS

Optional: There are development tools such as gcc-c++ and make that you need to have on your system, in order to build native addons from npm.

# yum install gcc-c++ make
OR
# yum groupinstall 'Development Tools'
Install Development Tools in CentOS

Install Development Tools in CentOS

How to Install Node.js 14 in Debian, Ubuntu and Linux Mint

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

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

------- On Ubuntu and Linux Mint ------- 
$ curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
$ sudo apt-get install -y nodejs

------- On Debian ------- 
# curl -sL https://deb.nodesource.com/setup_14.x | bash -
# apt-get install -y nodejs

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

------- On Ubuntu and Linux Mint ------- 
$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
$ sudo apt-get install -y nodejs

------- On Debian ------- 
# curl -sL https://deb.nodesource.com/setup_12.x | bash -
# apt-get install -y nodejs

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

------- On Ubuntu and Linux Mint ------- 
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs

------- On Debian ------- 
# curl -sL https://deb.nodesource.com/setup_10.x | bash -
# apt-get install -y nodejs

Optional: There are development tools such as gcc-c++ and make that you need to have on your system, in order to build native addons from npm.

$ sudo apt-get install -y build-essential

Testing Latest Nodejs and NPM in Linux

To have a simple test of nodejs and NPM, you can just check the versions installed on your system by using the following commands:

On RHEL, CentOS, and Fedora

# node --version
# npm --version

On Debian, Ubuntu and Linux Mint

$ nodejs --version
$ npm --version
Check NodeJS Version in CentOS

Check NodeJS Version in CentOS

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

I believe these were easy and simple steps to follow but in case of problems you faced, you can let us know and we find ways of helping you. I hope this guide was helpful to you and always remember to stay connected to Tecmint.

Sharing is Caring…
Share on FacebookShare on TwitterShare on LinkedinShare on Reddit

Related

Tags: nodejs, npm

vtop – A Linux Process and Memory Activity Monitoring Tool

Prev Post

How to Make Minecraft Server on Ubuntu 20.04

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 0
  • 254
  • 614,626

DesignLinux.com © All rights reserved

Go to mobile version