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
This entry was posted in CoffeeScript and tagged , . Bookmark the permalink.

5 Responses to Installing CoffeeScript on Ubuntu

  1. Mesbah says:

    Thanks, that was helpful,
    I am new to Linux & Ubuntu, followed the steps and coffee script was installed.
    looking forward to read more about how to actually use coffee script and generate java script.

    Regards

  2. Barnaby says:

    I’m using coffeescript at work now, and we used your tutorial for installing because the Ubuntu repo’s are behind the times and the PPA’s we found for it didn’t seem to have their packages built properly.

    Also, the vim plugin by kchmck is essential to working with coffeescript.

    I really hope CoffeeScript catches on because it’s so much better to work with than just plain old Javascript.

    Cheers

  3. Chris says:

    Thanks, very helpful, but I’ve found that being on the bleeding edge of node.js can cause problems (like the hang reported here http://stackoverflow.com/questions/6985457/cant-install-coffeescript-on-ubuntu-lts). Downgrading to the latest stable fixed the hang for me, just had to run this after the “git clone” and before the “./configure”

    git checkout v0.4.10

  4. Pingback: CoffeeScript, lidando com JavaScript sem sofrimento | Erko Bridee

  5. Pingback: PHP, CGI/Perl Script Installation Service

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">