我的服务端app.js启动时抱错了
来源:11-5 文件上传 API 开发
yogapay0058
2023-04-23
TypeError: Router.use() requires a middleware function but got a Object
at Function.use (/Users/imac/nodeMock/node_modules/express/lib/router/index.js:469:13)
at Object. (/Users/imac/nodeMock/router/index.js:22:8)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1180:10)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Module.require (node:internal/modules/cjs/loader:1028:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (/Users/imac/nodeMock/app.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
1回答
-
扬_灵
2023-04-24
同学你好,看一下Router.use的配置,这里错误提示是Router.use()需要一个中间件函数,但得到了一个Object
022023-04-26
相似问题