Installing Node.js v.4 with APT on Ubuntu 14.04

Node.js is an increasingly-popular JavaScript runtime that can be used to build server-side applications. Installing Node on Ububtu 14.04 via APT isn’t quite as straightforward as it could be, as the version in the default repositories is 0.10.25, dating back to early 2014.

Ways to install Node.js

You have a number of options at the Node.js download page, depending on your platform. Windows and Mac users have pre-built installers, but none currently exists for Ubuntu.

You could download the source via the link above and build it yourself, but who wants to do that when we have a package manager?

Add the NodeSource PPA to APT!

The good news is that we can install Node.js v.4 (and above) using APT. You just have to add the NodeSource PPA.

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -

And you can then install the Node.js package using APT as normal:

sudo apt-get install nodejs

Useful Links

Leave a Reply

Your email address will not be published. Required fields are marked *