gpt4 book ai didi

javascript - 大多数中间件(如 compress)不再与 Express 捆绑在一起

转载 作者:数据小太阳 更新时间:2023-10-29 06:06:43 24 4
gpt4 key购买 nike

我刚刚安装了 sails@v0.9.16、express@4.0.0、compression@1.0.1 和 compress@0.1.9(只是为了确定)。但是我在运行 sails lift

时仍然出现以下错误
/Users/myuser/myproject/backend/node_modules/express/lib/express.js:89
throw new Error('Most middleware (like ' + name + ') is no longer bundle
^
Error: Most middleware (like compress) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
at Function.Object.defineProperty.get (/Users/myuser/myproject/backend/node_modules/express/lib/express.js:89:13)
at Object.module.exports.express.customMiddleware (/Users/myuser/myproject/backend/config/passport.js:127:20)
at Array.loadExpress [as 1] (/usr/local/lib/node_modules/sails/lib/express/index.js:162:25)
at listener (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:462:46)
at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:416:17
at Array.forEach (native)
at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:32:24)
at Object.taskComplete (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:415:13)
at processImmediate [as _immediateCallback] (timers.js:330:15)

知道为什么吗?

最佳答案

Sails 不正式支持 Express 4; Sails package.json 中的 Express 依赖项是 set to an explicit version 是有原因的!您可以使用此处的其他答案来尝试让您的 Sails 应用程序运行,但在我们更新核心以使用新的 Express 之前,您只能靠自己了。

我们正计划与 Express 团队联系,以尝试在未来更好地同步发布,但目前我们正在努力获得稳定的 Sails v0.10 版本!

关于javascript - 大多数中间件(如 compress)不再与 Express 捆绑在一起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23102030/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com