当我执行此命令时,它是正确的 -
coffee -v
它的输出是正确的.CoffeeScript版本1.6.1 但是当我输入
$ coffee
它出错了,日志低于
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object #<Object> has no method 'split'
at Interface.setPrompt (readline.js:121:24)
at new REPLServer (repl.js:128:7)
at Object.start (repl.js:249:14)
at Object.start (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js:95:23)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:76:32)
at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
我需要你的帮助
答案 0 :(得分:2)
这是CoffeeScript开发人员的设计决定。
https://github.com/jashkenas/coffee-script/issues/2813
CoffeeScript REPL不再支持Node v0.6。您应该能够通过传递文件进行编译。如果您希望它工作,您将需要使用旧版本的CoffeeScript或更新版本的Node。