【问题标题】:Typescript compile error: Property 'raw' does not exist on type 'typeof e' on express打字稿编译错误:快递类型'typeof e'上不存在属性'raw'
【发布时间】:2022-06-22 00:01:52
【问题描述】:

我看到很多例子,他们在请求中使用 express.raw() 或 express.raw({type: 'application/json'}) 作为中间件...但是 .raw() 不存在快递,还是快递?

我正在使用打字稿并表达:4.16.4

Typescript compile error: Property 'raw' does not exist on type 'typeof e' on express

【问题讨论】:

    标签: node.js typescript express


    【解决方案1】:

    express.raw() 是在 4.17.0 版本中引入的,请参阅 Release Notes

    通过更新你的明确依赖,你应该能够使用中间件。

    【讨论】:

      猜你喜欢
      • 2015-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-26
      • 2017-09-29
      • 1970-01-01
      • 2021-08-29
      • 2021-02-19
      相关资源
      最近更新 更多