How Do I Install NodeJS on Ubuntu 14.04?

Sometimes it's necessary to use an old version of Linux such as Ubuntu 14.04. Unfortunately, some newer packages aren't available via apt on these releases, they are way past the supported date. Long term support (LTS) for Ubuntu, is now 16.04 LTS.

Many popular packages provide back ports. Googling will present a bunch of complicated options for installing NodeJS for instance. In reality, the best method is just two commands provided by NodeJS docs themselves:

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

For more details see:

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions