小编Dat*_*ise的帖子

TypeError:Router.use()需要中间件函数但是有一个Object

新版本的快递上有一些中间件变化,我在这个问题上围绕其他一些帖子对我的代码进行了一些更改,但我无法坚持下去.

我们手头工作但我不记得改变是什么.

throw new TypeError('Router.use() requires middleware function but got a
        ^
TypeError: Router.use() requires middleware function but got a Object
Run Code Online (Sandbox Code Playgroud)
node ./bin/www

js-bson: Failed to load c++ bson extension, using pure JS version
js-bson: Failed to load c++ bson extension, using pure JS version
Run Code Online (Sandbox Code Playgroud)
/Users/datis/Documents/bb-dashboard/node_modules/express/lib/router/index.js:438
      throw new TypeError('Router.use() requires middleware function but got a
            ^
TypeError: Router.use() requires middleware function but got a Object
    at /Users/datis/Documents/bb-dashboard/node_modules/express/lib/router/index.js:438:13
    at Array.forEach (native)
    at Function.use (/Users/datis/Documents/bb-dashboard/node_modules/express/lib/router/index.js:436:13)
    at /Users/datis/Documents/bb-dashboard/node_modules/express/lib/application.js:188:21
    at Array.forEach (native)
    at Function.use …
Run Code Online (Sandbox Code Playgroud)

javascript node.js express

140
推荐指数
9
解决办法
18万
查看次数

标签 统计

express ×1

javascript ×1

node.js ×1