【发布时间】:2021-01-26 02:02:33
【问题描述】:
编译以下代码时出现以下错误: 我是 nestjs 新手,这是附加的示例应用程序代码。 我也尝试用 UsersModule 替换 module.ts 中的 UsersService,但它没有用。我做错了什么?
[Nest] 19960 - 10/19/2020, 11:42:09 PM [NestFactory] Starting Nest application...
[Nest] 19960 - 10/19/2020, 11:42:09 PM [InstanceLoader] MongooseModule dependencies initialized +25ms
[Nest] 19960 - 10/19/2020, 11:42:09 PM [InstanceLoader] PassportModule dependencies initialized +1ms
[Nest] 19960 - 10/19/2020, 11:42:09 PM [ExceptionHandler] Nest can't resolve dependencies of the AuthService (?, JwtService). Please make sure that the argument UsersService at index [0] is available in the AuthService context.
Potential solutions:
If UsersService is a provider, is it part of the current AuthService?
If UsersService is exported from a separate @module, is that module imported within AuthService?
@module({
imports: [ /* the Module containing UsersService */ ]
})
【问题讨论】:
标签: node.js typescript nestjs