【发布时间】:2021-10-14 06:09:13
【问题描述】:
目前,当我使用 yarn install 在我的 nestjs 项目上安装 swagger 时,出现以下错误。有什么想法可能导致这种情况吗?
src/ledger/dtos/addOrdersByDate.dto.ts:2:10 - 错误 TS2724:模块 '"../../../node_modules/@nestjs/swagger"' 没有导出成员 'ApiModel 属性'。您是说“ApiHideProperty”吗?
2 从“@nestjs/swagger”导入 { ApiModelProperty }; ~~~~~~~~~~~~~~~~~~~
node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25 1 导出声明函数ApiHideProperty():PropertyDecorator; ~~~~~~~~~~~~~~~ 'ApiHideProperty' 在这里声明。
src/ledger/dtos/addRebatesCharges.dto.ts:1:10 - 错误 TS2724:模块 '"../../../node_modules/@nestjs/swagger"' 没有导出成员 'ApiModel 属性'。您是说“ApiHideProperty”吗?
1 从“@nestjs/swagger”导入 { ApiModelProperty }; ~~~~~~~~~~~~~~~~~~~
node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25 1 导出声明函数ApiHideProperty():PropertyDecorator; ~~~~~~~~~~~~~~~ 'ApiHideProperty' 在这里声明。
src/ledger/dtos/addReturns.dto.ts:2:10 - 错误 TS2724:模块 '"../../../node_modules/@nestjs/swagger"' 没有导出成员 'ApiModel 属性'。您是说“ApiHideProperty”吗?
2 从“@nestjs/swagger”导入 { ApiModelProperty }; ~~~~~~~~~~~~~~~~~~~
node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25 1 导出声明函数ApiHideProperty():PropertyDecorator; ~~~~~~~~~~~~~~~ 'ApiHideProperty' 在这里声明。
src/ledger/dtos/addSellers.dto.ts:2:10 - 错误 TS2724:模块 '"../../../node_modules/@nestjs/swagger"' 没有导出成员 'ApiModel 属性'。您是说“ApiHideProperty”吗?
2 从“@nestjs/swagger”导入 { ApiModelProperty }; ~~~~~~~~~~~~~~~~~~~
node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25 1 导出声明函数ApiHideProperty():PropertyDecorator; ~~~~~~~~~~~~~~~ 'ApiHideProperty' 在这里声明。
src/ledger/dtos/block.dto.ts:2:10 - 错误 TS2724:模块 '"../../../node_modules/@nestjs/swagger"' 没有导出成员 'ApiModel 属性'。您是说“ApiHideProperty”吗?
2 从“@nestjs/swagger”导入 { ApiModelProperty }; ~~~~~~~~~~~~~~~~~~~
node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25 1 导出声明函数ApiHideProperty():PropertyDecorator; ~~~~~~~~~~~~~~~ 'ApiHideProperty' 在这里声明。
src/ledger/dtos/transaction.dto.ts:1:10 - 错误 TS2724:模块 '"../../../node_modules/@nestjs/swagger"' 没有导出成员 'ApiModel 属性'。您是说“ApiHideProperty”吗?
1 从“@nestjs/swagger”导入 { ApiModelProperty }; ~~~~~~~~~~~~~~~~~~~
node_modules/@nestjs/swagger/dist/decorators/api-hide-property.decorator.d.ts:1:25 1 导出声明函数ApiHideProperty():PropertyDecorator; ~~~~~~~~~~~~~~~ 'ApiHideProperty' 在这里声明。
src/queue/controllers/queue.controller.ts:2:10 - 错误 TS2305:模块 '"../../../node_modules/@nestjs/swagger"' 没有导出成员 'ApiUseTags'。
2 导入 { ApiUseTags, ApiOperation, ApiResponse } 从 '@nestjs/swagger'; ~~~~~~~~~~
src/queue/controllers/queue.controller.ts:10:19 - 错误 TS2345: '{ title: string; 类型的参数}' 不可分配给参数 “部分”类型。对象字面量只能指定 已知属性,并且类型中不存在“标题” '部分'。
10 @ApiOperation({ title: '列出消息数量的队列' }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/controllers/configuration.controller.ts:2:24 - 错误 TS2305:模块 '"../../../node_modules/@nestjs/swagger"' 没有 导出成员“ApiUseTags”。
2 从 '@nestjs/swagger' 导入 { ApiOperation, ApiUseTags }; ~~~~~~~~~~
src/shared/controllers/configuration.controller.ts:12:19 - 错误 TS2345:类型参数 '{ 标题:字符串; }' 不可分配给 “部分”类型的参数。对象字面量可能 只指定已知属性,并且类型中不存在'title' '部分'。
12 @ApiOperation({ title: '获取配置变量' }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/controllers/history.controller.ts:2:24 - 错误 TS2305: 模块 '"../../../node_modules/@nestjs/swagger"' 没有导出 成员“ApiUseTags”。
2 从 '@nestjs/swagger' 导入 { ApiOperation, ApiUseTags }; ~~~~~~~~~~
src/shared/controllers/history.controller.ts:10:19 - 错误 TS2345: '{ title: string; 类型的参数}' 不可分配给参数 “部分”类型。对象字面量只能指定 已知属性,并且类型中不存在“标题” '部分'。
10 @ApiOperation({ title: '获取实体的历史记录' }) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/filters/http-exception.filter.ts:24:34 - 错误 TS2339: 类型“字符串”上不存在属性“错误”。
24 错误:exception.message.error, ~~~~~
src/shared/filters/http-exception.filter.ts:25:36 - 错误 TS2339: “字符串”类型不存在属性“消息”。
25 消息:exception.message.message, ~~~~~~~
src/shared/filters/http-exception.filter.ts:35:34 - 错误 TS2339: 类型“字符串”上不存在属性“错误”。
35 错误:exception.message.error,
【问题讨论】:
标签: node.js typescript swagger