Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

typing express & nestjs, start project errors

I’m using nestJS. When I start the project, I have the following error. Is it a problem from the @types/express package ? Or is it something I did wrong ? Thanks.

[14:17:06] Starting compilation in watch mode...

node_modules/@types/express/index.d.ts:99:42 - error TS2344: Type 'P' does not satisfy the constraint 'Params'.
      Type 'P' is not assignable to type 'ParamsArray'.

     extends core.ErrorRequestHandler<P, ResBody, ReqBody, ReqQuery> { }
                                        ~

node_modules/@types/express/index.d.ts:108:124 - error TS2344: Type 'P' does not satisfy the constraint 'Params'.
      Type 'P' is not assignable to type 'ParamsArray'.

     interface Request<P = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.Request<P, ResBody, ReqBody, ReqQuery> { }
                                                                                                                          
node_modules/@types/express/index.d.ts:109:138 - error TS2344: Type 'P' does not satisfy the constraint 'Params'.
      Type 'P' is not assignable to type 'ParamsArray'.

     interface RequestHandler<P = core.ParamsDictionary, ResBody = any, ReqBody = any, ReqQuery = core.Query> extends core.RequestHandler<P, ResBody, ReqBody, ReqQuery> { }
                                                                                                                                        
[14:17:17] Found 3 errors. Watching for file changes.
like image 705
Seraf Avatar asked Sep 07 '20 12:09

Seraf


1 Answers

I had the same problem with compilation, though just deleting package-lock.json didn't work for me. However, this did: npm update @types/express-serve-static-core --depth 1... It's suggested in the linked issue

like image 159
MarshHawk Avatar answered Oct 18 '22 19:10

MarshHawk