How to setup Node.js, NPM and CoffeeScript on Ubuntu

October 28th, 2011 at 7:54 pm 1 Comment

After visiting half a dozen different sites trying to figure out how to install Node.js, NPM and CoffeeScript on Ubuntu, I gathered up everything here so next time I have to do an install it will all be in one spot. This is current for Ubuntu 11.10.

Install Node.js
This will install Node.js v0.4.12, currently the latest stable version. Remember even-numbered versions of Node.js are stable, while odd-numbered versions are considered unstable.

$ sudo apt-get update
$ sudo apt-get install git-core curl build-essential openssl libssl-dev
$ git clone https://github.com/joyent/node.git && cd node
$ git checkout v0.4.12
$ ./configure
$ make -j2
$ sudo make install
$ node --version

Install NPM

$ curl http://npmjs.org/install.sh | sudo sh
$ npm --version

Install CoffeeScript

$ sudo  npm install -g coffee-script
$ coffee --version

Set up NODE_PATH
This step will let you use/include all your Node libraries (including CoffeeScript) in Node.

Add this to your ~/.bashrc file:

export NODE_PATH=/usr/local/lib/node_modules

1 Response to “How to setup Node.js, NPM and CoffeeScript on Ubuntu”

  1. Andrew @mysqlboy
    November 14th, 2011 at 6:40 am

    Great article and one of the dozens I’ve visited to look at regular installation practice.

    Thanks again.


Leave a Comment