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