gpt4 book ai didi

typescript - 输入 express & nestjs,启动项目错误

转载 作者:行者123 更新时间:2023-12-03 16:32:43 24 4
gpt4 key购买 nike

我正在使用 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.

最佳答案

如前所述 here ,只需删除 package-lock.json,然后重新安装包。

关于typescript - 输入 express & nestjs,启动项目错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63777580/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com