Install the latest version of npm and Nodejs on GNU/Linux Debian
By
Darío Rivera
Posted On
in
GNU/Linux Debian
It is common to find that the stable version of GNU/Linux Debian does not have updated npm and nodejs packages. Whether you need to update npm or nodejs only, in this post, we will show you how to do it.
Installation
The first thing you should do is to add the PPA to your system from the official Nodejs repository. In addition to this, you also need to install the software-properties-common package if it is not already on your system. In this case, we will suppose that you are going to install the latest LTS version.
sudo apt-get install curl software-properties-common
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
After this, you can execute the command to install nodejs.
apt-get install -y nodejs
Do not forget to verify the version of each component with the following commands.
$ node -v
v12.16.2
$ npm -v
6.14.4
Until next time.