Install the newest Node.js on Debian
It is possible to install the newest package of Node.js in Debian and Debian-based distros by adding the NodeSource repository. Official Debian repository contains only the old version of Node which is not supported by some projects. Follow these steps to install the newest available version.
Add NodeSource repository
The following command updates our Debian apt package repository to include the NodeSource packages.
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash --
Install Node.js from added repository
sudo apt-get install nodejs
Note: if you already have nodejs installed, remove it before installing a newer version.
Test and check version of installed Node.js
$ node -v
Launching the Node REPL
Now NPM (Node Package Manager) should be also installed in the newest version available.