初学node,到处撞墙!今天google了一天,也没有解决! "dependencies": { "body-parser": "~1.12.4", "bootstrap": "^3.3.4", "cookie-parser": "~1.3.5", "debug": "~2.2.0", "ejs": "~2.3.1", "express": "~4.12.4", "morgan": "~1.5.3", "serve-favicon": "~2.2.1", "mongodb": "1.4.15", "express-session": "1.9.1", "connect-mongo": "0.8.0", "connect-flash": “0.1.1” }
var session = require(‘express-session’); var MongoStore = require(‘connect-mongo’)(session);
大概定位到这!已经接近奔溃了
好吧!我再描述一下问题。错误提示:TypeError: Cannot read property ‘length’ of undefined at processResults (/workdir/project/blog/node_modules/mongodb/lib/mongodb/db.js:1603:31) at /workdir/project/blog/node_modules/mongodb/lib/mongodb/db.js:1641:20 at /workdir/project/blog/node_modules/mongodb/lib/mongodb/db.js:1179:7 at /workdir/project/blog/node_modules/mongodb/lib/mongodb/db.js:1912:9 at Server.Base._callHandler (/workdir/project/blog/node_modules/mongodb/lib/mongodb/connection/base.js:448:41) at /workdir/project/blog/node_modules/mongodb/lib/mongodb/connection/server.js:481:18 at MongoReply.parseBody (/workdir/project/blog/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5) at null.<anonymous> (/workdir/project/blog/node_modules/mongodb/lib/mongodb/connection/server.js:439:20) at emit (events.js:107:17) at null.<anonymous> (/workdir/project/blog/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:201:13)