Getting Started with Node.js on Ubuntu

Getting started with Node.js is an incredibly easy process. I'm going to describe how to get set up on Ubuntu 12.04.

First, go to http://nodejs.org/ and download the source code.  If the phrase 'source code' makes the back of your neck prickly, don't worry -- this is about as simple as you can possibly get.

Be sure that you have the build tools installed:
sudo apt-get install build-essential

Unpack the source code and launch a terminal in the directory with the source code. Then you will need to build the code:

./configure
make
sudo make install

Node.js is built on the V8 javascript engine that's part of the Chrome browser, and that's what is building now. I'm using a very ancient laptop running the Xubuntu linux variant, and Node takes about five minutes to build.  On more powerful hardware, you'll barely notice it.

Why build from source and not use a package from the Ubuntu repository?  From what I've heard, the official packages are usually quite out of date. For example, at the time of this writing the apt-get version is 0.6.12 and the official node version is 0.8.15.  I'm not sure what the practical impact of that is, but it's nice to have control of being up-to-date.

Once it's done building and installing, you're ready to go.  Let's test it out:

matsu@matsu-Latitude-D600:~/Downloads/node-v0.8.15$ node
> console.log("hello world!");
hello world!

It's installed and working. Cool!

Comments

Popular posts from this blog

FREE Delphi Starter Edition

Getting Homebrew Set Up For Non-Admin Account on Your Mac OSX 10.8

Mono Versions in Unity 3.5.7 and 4.3.4