在nodejs的app.js中出现了 has no method 'helpers',怎么解决呢
发布于 9个月前 作者 wangxuq 601 次浏览

var util = require(‘util’); app.helpers({ inspect: function(obj) { return util.inspect(obj, true); } }); app.dynamicHelpers({ headers: function(req, res) { return req.headers; } }); 下边是错误: TypeError: Object function app(req, res, next){ app.handle(req, res, next); } has no method ‘helpers’ at Object.<anonymous> (E:\nodejs\lianxi\microblog\app.js:35:5) at Module._compile (module.js:456:26) at Object.Module._extensions…js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

2 回复

我用的是3.5 。谢谢你啊!

回到顶部