繁体   English   中英

构建失败,因为没有从 express-serve-static-core 导出 ParsedQs

[英]Build failed because of no export of ParsedQs from express-serve-static-core

我遇到了[@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";

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

在这里,我按照以下步骤找到了解决方案:

  1. npm 删除@types/express && npm 添加@types/express@latest
  2. 删除@types/express-serve-static-core
  3. npm 更新@types/express-serve-static-core --depth 1
  4. npm 删除@types/express && npm i @types/express-serve-static-core@latest

解决问题

谢谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM