How to install NPM and NodeJs on Xubuntu 16.04

How to install NPM and NodeJs on Xubuntu 16.04

If you are a javascript developer and want to build backend part of your application using javascript, then nodejs is the perfect choice for you. Using nodejs you can create backend APIs as well as the frontend interface. 

Of course before you can start building application with nodejs, you need to install nodejs itself as well as the package manager of nodejs which is the NPM (node package manager). Installing nodejs and npm is very easy on xubuntu.

How to install nodejs on xubuntu 16.04
simply run this command to install nodejs on xubuntu 16.04
sudo apt-get install nodejs
On xubuntu 16.04 the command above will install nodejs version 4.2.6, which is not the latest one, later i will show you how to upgrade nodejs to the latest version, but for now, we need to install node package manager or NPM.

How to install NPM on xubuntu 16.04
sudo apt-get install build-essential
sudo apt-get install npm

Make sure you already have curl installed before upgrading nodejs to the latest version
sudo apt-get install curl

How to upgrade nodejs to version 6
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
How to pgrade to nodejs to version 7
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs

How to upgrade to nodejs to version 8
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Share this

Previous
Next Post »