我是 node.js 的新手,我选择 geddy 来启动一个示例应用程序。我试图执行这个命令:
geddy scaffold news title:string
但是当我运行应用程序时,我收到了一个错误
Error: 500 Internal Server Error
TypeError: ejs:11
<%- linkTo(news[i].title, newsPath(news[i].id)); %>
string is not a function
at handleErr (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:58:15)
at Object.rethrow (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:90:41)
at eval (eval at (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:88:10), :2:925)
at C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\engines\ejs.js:101:17
at ejs.render (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\adapters\ejs.js:28:10)
at Adapter.render (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\adapters\index.js:122:22)
at Partial.renderSelf (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\partial.js:128:28)
at handleData (C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\partial.js:101:16)
at C:\Users\tschl_000\AppData\Roaming\npm\node_modules\geddy\lib\template\partial.js:119:9
at fs.js:266:14
我认为这个错误是由单数/复数问题发生的,因为当我删除对“newsPath”的调用时,它起作用了。有谁知道如何使它工作?