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
你在用express 幾 3.0 後就沒了helpers https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x
我用的是3.5 。谢谢你啊!