coffee script进入REPL报错问题记录

来源:互联网 发布:来疯直播软件 编辑:程序博客网 时间:2024/05/22 20:45

coffee script进入REPL(Read-Eval-Print-Loop)报错如下

coffee> /usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js:48
initialPrompt: repl.prompt.replace(/^[^> ]*/, function(x) {
^
TypeError: undefined is not a function
at addMultilineHandler (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js:48:34)
at Object.module.exports.start (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js:155:7)
at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:79:32)
at Object. (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Function.Module.runMain (module.js:490:10)
at startup (node.js:124:16)
at node.js:807:3

参照https://github.com/ehuss/coffee-script/commit/03705c674fe34b9498ede5a59de8bcc0679825f1所示的js代码修改/usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js

错误原因出在nodejs版本1.x之后的版本会报错,如果不是1.x版本的node,参照如上链接的js文件修改

0 0
原创粉丝点击