Unable to install latest NodeJS version on Ubuntu 14.04

The easiest way to install NodeJS is using the official PPA (which contain the latest version (8.X at the time of this edit).

Open a terminal (Ctrl+Alt+T) and run :

  1. Remove current NodeJS installation

    sudo apt-get purge nodejs*
    
  2. Install curl

    sudo apt-get install curl
    
  3. Install NodeJS:

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

If you absolutely need 0.12 and not 4.1.1 version, run :

  1. Install NodeJS:

    curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
    sudo apt-get install -y nodejs