javascript - 由于没有从 express-serve-static-core 导出 ParsedQs,构建失败

标签 javascript node.js typescript express typescript-typings

我遇到了 [@types/express]-Type 'P' is not assignable to type 'ParamsArray' 的错误,通过安装这些特定的包 "@types/express": "^4.17.8", "@types/express-serve-static-core": "^4.17.13" 解决了错误在下面抛出一个新错误。我试图降级 "@types/express-serve-static-core""^4.17.5"并安装 qs ,但这些都不起作用。
有关如何修复此错误的任何建议?node_modules/@types/express-serve-static-core/index.d.ts:30:10 - error TS2305: Module '"../qs"' has no exported member 'ParsedQs'.30 import { ParsedQs } from "qs";

最佳答案

该软件包似乎是一个已知问题( see this issue )。我认为尚未发布更新,但同时您可以使用 --skipLibCheck防止 tsc 深入查看软件包并发现该错误。 This thread解释了该标志的作用。

关于javascript - 由于没有从 express-serve-static-core 导出 ParsedQs,构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64660055/

相关文章:

javascript - 为什么 "node.js/Crawler"无法在Windows上安装?

javascript - 从 API(对象)创建 Promise

javascript - 如何使用node js分块上传大文件

javascript - 多重继承(样式化组件)

javascript - 如何在没有 HTTP 的情况下从 Angular2 (TypeScript) 中的 json 获取数据?

javascript - 为什么点击div后形成循环?

javascript - 什么 AngularJS 设计模式可以与具有一组公共(public)字段的 2 个服务一起使用?

javascript - .js 页面之间的 jQuery 函数 require() 调用

Angular2 Material 'md-icon' 不是已知元素

javascript - 从 type=file 按钮打印文件名