1

Just getting started with Coffeescript and have installed it correctly , however having problems getting basic compilation to work

I have 2 folders names 'src' and 'js'

I create a simple .coffee file in the src folder called test.coffee

In the parent folder I open a terminal window and type the following

coffee -wc src -o js

This SHOULD automatically compile any .coffee files in the src folder and put in the js folder but I always get an error

File not found: –wc.coffee

What am I doing wrong?

2 Answers 2

3

Coffee is picky about parameter order.

Usage: coffee [options] path/to/script.coffee -- [args]

As you see, you have to specify all options before the script (or directory) you want to compile:

coffee -w -c -o js src

or

coffee -wco js src
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Is Coffeescript also picky about the actual text editor you use to create the .coffee files? Now getting a different error> In src/test.coffee, Parse error on line 1: Unexpected ''
@eco_bach: Nope, not that I know of! I know my colleague has problems with hitting alt+space, which looks like a space but isn't. Might be syntax, too -- sometimes coffeescript gives a little cryptic error messages for some syntax errors. Could you post the file?
0

According to the usage examples on coffeescript.org, the "watch" functionality is for files, not directories.

Try dropping the -w.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.