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";
3 Answers
Reset to default 3It 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:
- npm remove @types/express && npm add @types/express@latest
- delete the @types/express-serve-static-core
- npm update @types/express-serve-static-core --depth 1
- 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]