0
我试图编译.coffee文件到.js文件,但我不断收到这个错误我不知道什么是错,但在此先感谢Coffeescript解析错误意外'。'
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>
完全正确。当你自己运行'coffee'时,你输入REPL,在那里你需要输入CoffeeScript表达式,而不是shell命令。按下Ctrl + C退出REPL。 – 2011-12-23 19:02:37