Install Node.JS on your Ubuntu Machine

So I recently heard about this thing called Node.JS.  To be honest, I’m a little skeptical, but I like what I have seen so far on the Node.JS website, and on some webcasts.

I like hands-on learning, so while I was going through the how-to videos I wanted to use Node.JS to follow along.  So, here are the steps to get Node.JS and Node Package Manager on your Ubuntu machine.

Here is my setup:

Ubuntu 11.04 64 bit (Natty Narwhal)

Asus G73JW-A1 (RoG)

I am installing on a VMWare Natty Narwhal 32 bit image.

1. Install some needed packages

You’ll need some packages from synaptic to start:

  1. curl
  2. libcurl4-openssl-dev

So open up Synaptic Package Manager, and install those 2 packages (and of course the dependencies too).  If you don’t know how to install the packages, you probably should not be trying to use NodeJS, stick with ASP.NET MVC 😉

2.  Install and Build NodeJS

So according to the webcasts I have seen, since NodeJS in “bleeding edge”, it is best to download and compile from the source.

Soooooo…..

  1. Go to http://nodejs.org/#download
  2. Copy link location
    • Nodejs Download Link Location
  3. Open up Terminal
  4. Enter your Downloads directory
    • cd Downloads/
  5. Enter the command in Terminal: curl -O, then paste the link you copied (should look like below)
    • Note: The version number in the link will most likely change as of the time of this writing
    • curl -O http://nodejs.org/dist/node-v0.4.7.tar.gz
  6. Once NodeJS is downloaded, unzip the file
    • tar -xvf node-v0.4.7.tar.gz
  7. Change Directory to Node Directory you just unzipped
    • cd node-v0.4.7/
  8. Configure and Make, the making could take a while, so go grab yourself a coffee after you run the make command
    • ./configure
      • if configure succeeds it should say: ‘configure’ finished successfully
      • Configure Succeeded
    • sudo make && sudo make install
    • Node Build Succeeded
  9. Verify NodeJS got installed
    • node --version
    • Node Version
  10. You now have Node.JS installed, you can delete the stuff you downloaded and unzipped

3.  Install Node Package Manger

  1. For starters we do NOT want to do Node Package Management with sudo, so according to this article, this is our first command
    • Open Terminal
    • sudo chown -R $USER /usr/local
  2. Install Node Package Manager
    • curl http://npmjs.org/install.sh | sh
  3. Verify Node Package Manager (npm) got installed
    • npm --version
    • Node Package Manager Install

Congratulations!  You now have NodeJS and Node Package Manger installed on you Ubuntu machine!  Time to start coding with NodeJS!  I don’t know how to yet, but you need to start somewhere 🙂

Please add comments or questions below.

End of Line.

Advertisements
  1. #1 by laabroo on May 21, 2011 - 16:53

    thanks to your tutorial Mr . It’s worked in my Ubuntu machine 😀

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: