《nodejs开发指南》TypeError: Cannot call method 'toLowerCase' of undefined错误怎么解决
具体的错误提示是这样的
TypeError: Cannot call method 'toLowerCase' of undefined
at Router.matchRequest (/Users/zhuyifan/Desktop/microblog/node_modules/express/lib/router/index.js:185:27)
at pass (/Users/zhuyifan/Desktop/microblog/node_modules/express/lib/router/index.js:104:30)
at Router._dispatch (/Users/zhuyifan/Desktop/microblog/node_modules/express/lib/router/index.js:170:5)
at Function.router (/Users/zhuyifan/Desktop/microblog/node_modules/express/lib/router/index.js:33:10)
at Object.<anonymous> (/Users/zhuyifan/Desktop/microblog/app.js:33:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
app.js的33行代码是
app.use(express.router(routes));
9 回复