【发布时间】:2020-12-25 21:01:06
【问题描述】:
我正在使用nestJS。当我启动项目时,出现以下错误。 @types/express 包有问题吗?还是我做错了什么? 谢谢。
[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.
【问题讨论】:
-
你能分享你的
package.json文件吗? -
仅供参考:在 GH 存储库中提出了一个关于 github.com/DefinitelyTyped/DefinitelyTyped/issues/47339 的问题
-
@davidlj95 谢谢。我一直在寻找一个打开的问题,但它还没有打开。而且不是我自己做的,我担心这只是我和我的项目。
标签: typescript express node-modules nestjs typescript-typings