var flash = require(‘connect-flash’); app.use(flash());
引用时出现下面问题。新手求指点。 req.flash() requires sessions
undefined
Error: req.flash() requires sessions at Error (<anonymous>) at IncomingMessage._flash [as flash] (D:\MyDevelop\express_test\blogs\node_modules\connect-flash\lib\flash.js:60:41) at D:\MyDevelop\express_test\blogs\routes\index.js:23:9 at Layer.handle [as handle_request] (D:\MyDevelop\express_test\blogs\node_modules\express\lib\router\layer.js:76:5) at next (D:\MyDevelop\express_test\blogs\node_modules\express\lib\router\route.js:100:13) at Route.dispatch (D:\MyDevelop\express_test\blogs\node_modules\express\lib\router\route.js:81:3) at Layer.handle [as handle_request] (D:\MyDevelop\express_test\blogs\node_modules\express\lib\router\layer.js:76:5) at D:\MyDevelop\express_test\blogs\node_modules\express\lib\router\index.js:234:24 at Function.proto.process_params (D:\MyDevelop\express_test\blogs\node_modules\express\lib\router\index.js:312:12) at D:\MyDevelop\express_test\blogs\node_modules\express\lib\router\index.js:228:12