使用nodeJs express运行我的服务器时,我会发现错误:
express-session deprecated undefined resave option; provide resave option server.js:16:9
express-session deprecated undefined saveUninitialized option; provide saveUninitialized option server.js:16:9
C:\openshift\nodejs\node_modules\express\lib\router\index.js:291
throw new Error(msg);
^
Error: .get() requires callback functions but got a [object Undefined]
at C:\openshift\nodejs\node_modules\express\lib\router\index.js:291:11
at Array.forEach (native)
at Router.route (C:\openshift\nodejs\node_modules\express\lib\router\index.js:287:13)
at Router.(anonymous function) [as get] (C:\openshift\nodejs\node_modules\express\lib\router\index.js:318:16)
at Function.app.(anonymous function) (C:\openshift\nodejs\node_modules\express\lib\application.js:412:26)
at Object.<anonymous> (C:\openshift\nodejs\server.js:31:5)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
PS C:\openshift\nodejs>
我该如何解决这个问题?
答案 0 :(得分:1)
您尝试传递给#get
方法的内容超出了范围,因此undefined
因此[object Undefined]
。
发布您的代码,它会更容易帮助您。