CNode

安装nodeclub的问题。

问答
Bbainana发布于10 年前最后回复10 年前4 回复3746 浏览0 收藏

安装完,node app.js,访问loalhost:3000时 出现这个错误: Connect 500 TypeError: Cannot read property 'user' of undefined。 会不会是因为mongo的版本问题。 请教各位怎么解决?谢谢!

查看回复

回复 (4)

H
Hi-Rube#1·10 年前

看具体报错位置

B
bainana#2·10 年前
引用 Hi-Rube看具体报错位置

@Hi-Rube 错误提示是这样的 Started 2016-11-27T01:35:07.263Z GET / ::1 TypeError: Cannot read property 'user' of undefined at exports.authUser (/Users/sundl/bbs/middlewares/auth.js:94:18) at Layer.handle [as handle_request] (/Users/sundl/bbs/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/Users/sundl/bbs/node_modules/express/lib/router/index.js:312:13) at /Users/sundl/bbs/node_modules/express/lib/router/index.js:280:7 at Function.process_params (/Users/sundl/bbs/node_modules/express/lib/router/index.js:330:12) at next (/Users/sundl/bbs/node_modules/express/lib/router/index.js:271:10) at initialize (/Users/sundl/bbs/node_modules/passport/lib/middleware/initialize.js:53:5) at Layer.handle [as handle_request] (/Users/sundl/bbs/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/Users/sundl/bbs/node_modules/express/lib/router/index.js:312:13) at /Users/sundl/bbs/node_modules/express/lib/router/index.js:280:7 at Function.process_params (/Users/sundl/bbs/node_modules/express/lib/router/index.js:330:12) at next (/Users/sundl/bbs/node_modules/express/lib/router/index.js:271:10) at session (/Users/sundl/bbs/node_modules/express-session/index.js:159:61) at Layer.handle [as handle_request] (/Users/sundl/bbs/node_modules/express/lib/router/layer.js:95:5)

S
scarletmu#4·10 年前

随手看了一眼这个位置读的是session,是不是配置里session相关的有问题啊

参与回复
登录后即可参与回复。登录