【发布时间】:2013-07-14 19:51:15
【问题描述】:
我正在用 express.js 和 coffeescript 制作我的第一个应用程序。代码位于: https://github.com/findjashua/contactlist
当我尝试运行它时,我收到以下错误:
/Users/jashua/local/lib/node_modules/coffee-script/lib/coffee-script/helpers.js:216
codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end
^
TypeError: Cannot call method 'slice' of undefined
at Object.exports.prettyErrorMessage (/Users/jashua/local/lib/node_modules/coffee-script/lib/coffee-script/helpers.js:216:27)
at compileScript (/Users/jashua/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:199:25)
at /Users/jashua/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:143:18
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)
我假设它与contacts.coffee 有关,但想不出任何东西。有什么想法吗?
【问题讨论】:
-
看起来像是咖啡脚本内部的错误。你运行的是最新版本吗?
-
是的,coffeescript(1.6.3) 和 express(3.3.4) 的最新版本。它在一个简单的 hello world 中运行良好(当我注释掉对 contacts.coffee 的调用时)
标签: javascript node.js express coffeescript slice