Hello and welcome computer geeks. Install Node JS & npm Cent OS. In this post we are going to talk about how you can install node JS in centos. No matter on which Cent OS version you are running. It can be version 7, version 8 or earlier versions. We will provide you step-by-step instruction installing node JS and npm on it. So without wasting any time let’s dive deeply into this informative post and achieve our goal. By the end of this post you will be able to install node.js and npm on your cent OS machine.
What is Node JS
What is npm
You must had used GitHub. You know that GitHub is a platform where you can share your projects and others can also contribute and use your project as open source. npm is also just like GitHub but the packages that npm consists are for node.js only. There are are thousands of packages available in npm repository which allows you to simplify many critical coding tasks. These npm packages are built by developers like you and then posted into npm directory. Once you have installed npm and node Cent OS you can simply used npm install command any of the packages.
Install Node JS & npm Cent OS Requirements
There is only one requirement to install node JS and npm in Cent OS is that you must have sudo and in simple word admin privileges to your Cent OS machine.
How to install Node JS in Cent OS
- Add NodeSource to your machine: – First of all you have to add NodeSource in your machine. It is simply a script which will allow you to install node JS in centos. To add NodeSource simply run the following command in your terminal.
curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
Here I am using version 10 of node.js. But you can also use any other version of node JS like version 14. But make sure to use only those version of node.js which have LTS (Long Time Support). To change the installation version of node JS simply change /setup_10.x to /setup_XX.x where capital X represent the number of version that you want to install.
2. Executing Node JS installation Script: – Now the next task is to execute that script which we have added in your system. Once that script is executed it will automatically install node JS and and npm in your Cent OS machine.
sudo yum install nodejs
This command may take some time to be executed completely. Because it is going to download and install Node JS and npm. If you are being asked for GPG Key then simply type Y and press enter. Once this command is successfully executed the next task is to check whether Node JS is installed on Cent OS yes or no.
3. Checking Node JS installation on Cent OS: –
You can verify the installation of Node JS in your Cent OS machine by just running the command which show current version of node.js installed in your system in terminal and that command is given below.
It should prompt the current version of node JS installed in your machine. You do not need to worry about installation of npm because it will be automatically installed when you install node.js. So at this time npm is automatically installed with node JS.
Also Read: Kali Linux vs Andrax. Which is best?
In this post we discussed about how we can install Node J.S in Cent OS. Not only node JS we also took a look on how to install npm in Cent OS. I hope that this post was helpful to you and you found this content informative.