How To Update Node.js On Kali Linux Machine

Introduction

Node.js is an open-source JavaScript runtime environment. 

In this blog, you will learn how to update node.js version with NPM on the Kali Linux machine.

Procedure to update Node.js with NPM

First of all, you need to open the terminal on your Kali Linux machine and check which node version is installed on your machine using the following terminal command,

node -v

Then you need to give the root permission using the following command,

sudo su

Enter your machine password. now you switched from super user to root user. 

Now download package information from all configured sources using the below command,

sudo apt update

 

NPM uses cache for downloading new packages for you. you need to clear your npm cache. Use the following command to clean,

npm cache clean --force

Now update node.js to the latest stable version by using the following command,

sudo npm install -g n  

Now your node.js is successfully updated to the latest stable version, to check node.js version use the following command,

npm -v

In my machine node.js is updated to 8.1.1 from 7.22.0

Thank you so much for reading this blog.