Install node and npm in linux operating System

Hey fellows in this post I will cover how to install the npm and node in linux. In this post we will cover the following points

1. Downloading the node form the node website

2. Unzip the node to any directory

3. Set up the path variable for node

4. Check the installation of the node

Let's get started

Step 1: Go to the nodejs site

NodeJs Site Home Page

Step 2: Click the LTS recommended for the most user button to download the node

Click the LTS button

Step 3: NodeJs Setup must be started to download

NodeJs Started to Download

Step 4: Extract the tar file to anywhere you like.

I will extract my tar file at /home/username for easy reference

extract the file

Type or copy paste this command on terminal --> tar -xvf node-v14.15.4-linux-x64.tar.xz && mv node-v14.15.4-linux-x64 nodeJs && sudo mv nodeJs /home/username

extracting file at location

Step 5: Go to your /home/username folder and press Ctrl + h to unhide the hidden files

Unhide the files img

Step 6: Open the .bashrc file in the text editor or IDE

Open bashrc file

Step 7: Go to the end of the file and paste this line of code

export PATH=your_location_here:$PATH

In my case I will provide mine as fellows

export PATH=$HOME/nodejs/bin:$PATH
add path to the file

The above code line is adding the nodejs path to the system environmental variables so you can access it from anywhere

Now open the new terminal window or tab

new terminal tab or window

Check the version of the node with the following code

node --version
node version command

This line of code should display the version of the node application as shown below:

Node Version Command Result
Back