has no method 'render'
发布于 11 年前 作者 wangxuq 3817 次浏览 最后一次编辑是 8 年前

我的出现了新问题:说是没有方法render E:\nodejs\lianxi\microblog>node app.js connect.multipart() will be removed in connect 3.0 visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives connect.limit() will be removed in connect 3.0 Express server listening on port 3000 TypeError: Object #<IncomingMessage> has no method 'render’ at E:\nodejs\lianxi\microblog\routes\index.js:8:7 at callbacks (E:\nodejs\lianxi\microblog\node_modules\express\lib\router\index.js:164:37) at param (E:\nodejs\lianxi\microblog\node_modules\express\lib\router\index.js:138:11) at pass (E:\nodejs\lianxi\microblog\node_modules\express\lib\router\index.js:145:5) at Router._dispatch (E:\nodejs\lianxi\microblog\node_modules\express\lib\router\index.js:173:5) at Object.router (E:\nodejs\lianxi\microblog\node_modules\express\lib\router\index.js:33:10) at next (E:\nodejs\lianxi\microblog\node_modules\express\node_modules\connect\lib\proto.js:193:15) at E:\nodejs\lianxi\microblog\node_modules\express\node_modules\connect\node_modules\express-session
index.js:350:9 at E:\nodejs\lianxi\microblog\node_modules\connect-mongo\lib\connect-mongo.js:222:17 at E:\nodejs\lianxi\microblog\node_modules\connect-mongo\node_modules\mongodb\lib\mongodb\collection
query.js:147:5 GET / 500 41ms

1 回复

找到原因了,是因为我把res.render写成了req.render;

回到顶部