最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Build failed because of no export of ParsedQs from express-serve-static-core - Stack Overflow

programmeradmin5浏览0评论

I was faced with an error of [@types/express]-Type 'P' is not assignable to type 'ParamsArray', the error was resolved by installing these specific packages "@types/express": "^4.17.8", "@types/express-serve-static-core": "^4.17.13" which throw a new error below. I have tried to downgrade "@types/express-serve-static-core" to "^4.17.5" and install qs, but none of these work.

Any suggestions on how to fix this error?

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";

I was faced with an error of [@types/express]-Type 'P' is not assignable to type 'ParamsArray', the error was resolved by installing these specific packages "@types/express": "^4.17.8", "@types/express-serve-static-core": "^4.17.13" which throw a new error below. I have tried to downgrade "@types/express-serve-static-core" to "^4.17.5" and install qs, but none of these work.

Any suggestions on how to fix this error?

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";

Share Improve this question asked Nov 3, 2020 at 9:28 tobslobtobslob 961 gold badge3 silver badges8 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 3

It seems to be a known problem with that package (see this issue). I don't think an update for that has been released yet, but in the meantime you can use --skipLibCheck to prevent tsc from looking into packages that deeply and finding that error. This thread explains what that flag does nicely.

Here I found the solution by following the steps below:

  1. npm remove @types/express && npm add @types/express@latest
  2. delete the @types/express-serve-static-core
  3. npm update @types/express-serve-static-core --depth 1
  4. npm remove @types/express && npm i @types/express-serve-static-core@latest

Solved Problem

Thanks.

Just follow the following thing

npm install [email protected]

npm install -D @types/[email protected]
发布评论

评论列表(0)

  1. 暂无评论