When I try to compile this script (first.coffe):
some_object =
property_a : 123
property_b : "hello"
I get following error:
In first.coffee, Parse error on line 2: Unexpected 'INDENT'
but when I use “try coffeescript” functionality of coffeescript website, everything seems to work fine, because output is exactly this:
var some_object;
some_object = {
property_a: 123,
property_b: "hello"
};
What am I doing wrong? I work on Ubuntu, so coffescript was installed from repositories.
Ubuntu 11.10 has an up-to-date CoffeeScript package. Older versions of Ubuntu may have a CoffeeScript package that is too old. If you are using an Ubuntu older than 11.10, uninstall that package and install a newer CoffeeScript.