我今天升级了connect-mongo npm,由于此错误,我的应用程序一直在崩溃。任何人都可以建议一种方法来解决这个问题吗?
错误:
/Users/ac360/Desktop/node/application/node_modules/connect-mongo/lib/connect-mongo.js:30
var Store = connect.session.Store;
^
TypeError: Cannot read property 'Store' of undefined
以下是我如何设置Connect-Mongo
//express/mongo session storage
app.use(express.session({
secret: 'MEAN',
store: new mongoStore({
url: config.db,
collection: 'sessions'
})
}));
答案 0 :(得分:2)
经过几个小时的搜索,这对我有用: https://github.com/mrzepinski/connect-mongo/commit/21359889c4c5b81db85183a7e0549500160cedf2
使用:
"connect-mongo": "^0.4.0",
"express": "^4.1.0",
"express-session": "^1.0.2",
"mongoose": "^3.8.8"