Tips for working with Node.js on Ubuntu

####Installing Nodejs from the standard Ubuntu repos.#### While this won’t get you bleeding edge 0.12.x, it will it will get you a relatively recent and stable version of 0.10.x. This probably isn’t a bad thing as 0.12.x is pretty new and not everything supports it - yet.

$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install nodejs

Important to note is that Ubuntu isn’t going to call the binary “node”. Instead, its going to call it “nodejs”. Regardless of the logic behind this decision, its an easy fix by creating a simple symlink:

$ sudo ln -s "$(which nodejs)" /usr/bin/node

From there, most people are going to want to work with Node’s package manager, NPM, so install this as well:

$ sudo apt-get install npm

At this point, you should be ready to rock with Node and NPM. To validate your setup, feel free to check your versions.

$ node -v
v0.10.25
$ npm -v
1.4.21

In the event that you want to try a newer version of Node, I would recommend using the stellar PPA’s provided by Nodesource. Full instructions for 0.12 and even Io.js can be found here: Node.js v0.12, io.js, and the NodeSource Linux Repositories

If you’re just getting started with Node, then I would recommend taking a look at the following resources to get you off to a good start:

  • Nodeschool.io - might take a few minutes to figure out the Workshops, but not a bad training method. Gets you right into the code.
  • CodeSchool - I’m a huge Pluralsight fan, so CodeSchool always gets a bump from me.
  • Human Javascript - While not a tutorial specifically on Node, it is a fantastic tutorial on building real apps with node and Ampersand.js and worth your time. The author (@HenrikJoreteg) is an old acquaintance of mine and kind of a big deal in the JavaScript world. His video tutorials are awesome as well!

Good luck and happy coding!

Curtis Rissi

Solutions Architect and Full Stack Engineer by day and mad scientist by night. I specialize in making the impossible possible through code and technology. I also make some crazy good Korean BBQ. You know you want to try it.

Disclaimer: I work for AWS, but unless otherwise stated, the words and thoughts expressed in this blog are my own.

comments powered by Disqus