Upgrade to Node.js 8.x on Ubuntu 17.10

Ubuntu 17.10, codenamed “Artful Aardvark” was released yesterday…

… with Node.js v6.11.4 #sadtrombone

It could be worse though, Debian 9.x (Stretch) still ships with Node v4… but
I’ll save how to remedy that for another post 😉

Now, I can’t imagine you came here to listen to me throw shade at distros that
aren’t Arch Linux, so let’s get to upgrading Node.js!

First, you’ll want to make sure that you have curl installed. Doesn’t hurt to
run an update while you’re in there as well:

sudo apt-get update
sudo apt-get install curl

Once that’s all done, you will need to download and run the install script
provided by NodeSource. It’s easy though and why we needed curl in the
previous step:

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

That’s going to take a minute while it sets up the repository and all of that
goodness. It will run apt-get update again for you as well. Once that’s done,
you can install Node v8.7 (as of the time of this writing)!

sudo apt-get install nodejs

If you already have Node.js installed, don’t worry, that command will just
upgrade the current version to the latest version.

To confirm that everything worked as expected, just spit out the version from
the node command to confirm:

node --version

That’s all there is to it! Now you’re running the latest version of Ubuntu and
the latest version of Node.js.

You’re so bleeding edge that I’m shocked you’re not running Arch 😛

Josh Sherman - The Man, The Myth, The Avatar

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Head of Engineering and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.

If you found this article helpful, please consider buying me a coffee.