This Question is Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
5 Replies Last post: 2012-4-30 下午6:25 by James Garza  
Blair Nilsson Newbie 5 posts since
2011-12-7
Currently Being Moderated

2011-12-7 下午2:39

Getting coffeescript to compile... how do you set it up?

Some documentation about how to set it up so it can compile would be nice…

 

The help files say

 

 

For executing CoffeeScript files, you need Node.js utility to be downloaded and installed on your machine.

Refer to usage instructions:

 

The usage instructions are... somewhat less then useful. I have coffee.exe compiler in path, and the latest version of coffeescript.js with it...

So... I have done everything it says to do... however... still nothing...

 

Idealy, I would like to be able to run .coffee files directly (and have Idea compile it in the background)

 

There is nothing in the Run/Debug windows around it… nothing in the compiler options in settings… just a whole world of nothing...

What you need to do to get Idea to compile / run it?

 

Also is there any chance of getting Node.js and compiler put in the plugin? or at least a setting somewhere where I can point Idea to the compiler, and have it work its magic from there?

Andrey Vokin JetBrains 48 posts since
2011-6-17
Currently Being Moderated
2011-12-7 下午7:34 in response to: Blair Nilsson
Re: Getting coffeescript to compile... how do you set it up?

Hello Blair,

 

As I understand you are Windows user, so you could install NodeJS for Windows (installer is here: http://nodejs.org/#download). Next step is to download CoffeeScript binaries, you could do it from here: http://github.com/jashkenas/coffee-script/tarball/master (just extract the archive and rename extracted folder to “coffeescript”). Then if you want to run .coffee file from command line you should create coffee.cmd file with content like this:

 

@echo off

"C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\coffeescript\bin\coffee" %*

 

Then add it to the PATH environment variable. Now you can run CoffeeScript file by this way:

 

coffee file_to_run.coffee

 

If you would like to run .coffee files from IntelliJ IDEA, you should install NodeJS plugin (go to Settings, select “Plugins” and press button “browse repositories”, select plugin “NodeJS” and press “Download and Install” menu item from context menu). Then add a new NodeJS  run configuration, specify path to node.exe file, in “Node parameters” put path to CoffeeScript library (in my case it is "C:\Program Files (x86)\coffeescript\bin\coffee"), specify working directory and file to run. That’s all.

 

And by the way, IntelliJ IDEA can show you result of compilation of CoffeeScript file (you should open the context menu and click on the “Compile CoffeeScript File” menu item).

 

 

 

Bryce Fischer Newbie 3 posts since
2011-12-10
Currently Being Moderated
2011-12-10 上午3:27 in response to: Blair Nilsson
Re: Getting coffeescript to compile... how do you set it up?

in windows, I'm able to get coffee to watch by using the following command:

 

node C:\Program Files (86)\coffee\coffee -cw $ProjectFileDir$

 

(setup as an external tool...)

James Garza Newbie 5 posts since
2011-8-8
Currently Being Moderated
2012-4-30 下午10:12 in response to: Andrey Vokin
Re: Getting coffeescript to compile... how do you set it up?

UPDATE: I've opened this question as a new post here:

 

http://devnet.jetbrains.net/thread/435953

 

I've followed the instruction here (including Blair's recommendations) and it does seem to be working but I never see any compiler errors in the run output window.  Window indicates "Process finished with exit code 1"  (1 means errors occurred).   If I run using the coffee.cmd file in a command window  I see the compiler errors.  Anyway to pipe the errors to the INTELLIJ run's output window? See attached image.  I'm using INTELLIJ 11.1.1.

 

idea coffeescript compile output.jpg

 

Message was edited by: James Garza

More Like This

  • Retrieving data ...