Installing CoffeeScript on Ubuntu

Unfortunately the current CoffeeScript package is for an old version. Thus, some manual work is needed to get the latest version working for you on Ubuntu. Here are the steps, we need to install Git, node.js, npm and finally CoffeeScript:

$ sudo apt-get update
# Install needed packages
$ sudo apt-get install git-core curl build-essential openssl libssl-dev
# Install node.js
$ git clone https://github.com/joyent/node.git && cd node
$ ./configure
$ make
$ sudo make install
$ cd
# Install npm
$ curl http://npmjs.org/install.sh | sudo sh
#Install CoffeeScript
$ sudo  npm install -g coffee-script

Now give it a shot:

$ coffee -i
coffee> square = (x) -> x * x
[Function]
coffee> square 5
25