Coffeescript Parse错误意外'。'

时间:2011-12-23 07:57:55

标签: javascript parsing compilation coffeescript bots

我正在尝试将.coffee文件编译成.js文件,但我不断收到此错误我不知道什么是错的,但提前感谢

C:\Documents and Settings\USER\Desktop\Bots\b>coffee
coffee> --bare -l --compile *.coffee
Error: In repl, Parse error on line 1: Unexpected '.'
at Object.parseError (C:\Documents and Settings\USER\Application Data\npm\no
de_modules\coffee-script\lib\coffee-script\parser.js:470:11)
at Object.parse (C:\Documents and Settings\USER\Application Data\npm\node_mo
dules\coffee-script\lib\coffee-script\parser.js:546:22)
at C:\Documents and Settings\USER\Application Data\npm\node_modules\coffee-s
cript\lib\coffee-script\coffee-script.js:40:22
at Object.eval (C:\Documents and Settings\USER\Application Data\npm\node_mod
ules\coffee-script\lib\coffee-script\coffee-script.js:123:10)
at Interface. (C:\Documents and Settings\USER\Application Data\np
m\node_modules\coffee-script\lib\coffee-script\repl.js:51:34)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
at ReadStream. (readline.js:82:12)
coffee>

1 个答案:

答案 0 :(得分:3)

我特别不了解CoffeScript,但在我看来,你试图在交互式shell中提供命令行选项。尝试将选项作为参数:

  

C:\ Documents and Settings \ USER \ Desktop \ Bots \ b> coffee --bare -l --compile * .coffee