Using CoffeeScript on Windows

Tuesday, September 20, 2011 10:19 PM

David Havelin was the guy who broke this news: you can now use CoffeeScript directly on windows.  Here’s what you need to do:

  • git clone git://github.com/jashkenas/coffee-script.git
  • cd coffee-script/bin
  • Download the latest node.exe (http://nodejs.org/dist/v0.5.7/node.exe) into the same directory.  Note the is an “unstable” version, but you can’t get away with 0.4.x
  • ./node coffee --compile c:\myfile.coffee

Finally, throw away all of your over-complex coffeescript on windows solutions.  Hopefully soon there will be a batch file.

Technorati Tags: ,
Comments
Gravatar
# re: Using CoffeeScript on Windows
Posted by Dan on 10/4/2011 3:49 PM
Not sure if you are using visual studio, but check out Mindscape web workbench for visual studio. It supports coffee script
Gravatar
# re: Using CoffeeScript on Windows
Posted by Francois Oligny-Lemieux on 10/5/2011 4:23 PM
Thanks for your post. BTW it seems you need two "-" in --compile, otherwise it doesn't work. In your post it appears as only one dash. It should be: ./node coffee --compile c:\myfile.coffee
Gravatar
# re: Using CoffeeScript on Windows
Posted by Julian on 10/8/2011 2:15 PM
@Dan: I was using the Mindscape Workbench before using this. The Mindscape stuff gets unusable on my machine beyond about 200 lines of coffeescript. My current project has about 1500. It's also pretty buggy, you keep discovering things that ought to compile correctly that just plain don't. (I suspect they're running a fairly old version of the compiler.)

@Francois. Thankyou, Windows Live Writer rewrote my -- as an en dash, which wasn't that useful. I've corrected it in the post.
Gravatar
# re: Using CoffeeScript on Windows
Posted by Luchs on 10/16/2011 1:14 AM
Huh, I've been using CoffeeScript on Windows since May, I just had to compile node myself, which wasn't exactly difficult. And a batch file for using coffee directly is done in two lines (you might have to adjust the path):

@echo off
node %~dp0\bin\coffee %*
Gravatar
# re: Using CoffeeScript on Windows
Posted by dizzib on 3/14/2012 5:25 PM
The following works for me...

npm install -g coffee-script

Although for some reason I couldn't get the -o option to output to a network share.
Gravatar
# re: Using CoffeeScript on Windows
Posted by Julian on 3/15/2012 5:28 PM
You're absolutely correct. As of 0.6, npm started to be bundled with the node distribution, making everything much easier. I'll update the main article when I get the chance.
Something to add?

Talking sense? Talking rubbish? Something I'm missing? Let me know!

Fields denoted with a "*" are required.

 (will not be displayed)

 
Please add 1 and 1 and type the answer here:

Preview Your Comment