我正在使用nestJs 后端,试图添加设置议程。我已经安装了议程、nestjs-agenda 和 @types/agenda 并在我的模块中注册了 AgendaModule,当我导入并尝试在我的服务中使用它时,出现以下错误。
node_modules/nestjs-agenda/dist/agenda.module.d.ts:4:44 - error TS2507: Type 'typeof Agenda' is not a constructor function type.
4 export declare class AgendaService extends Agenda {
~~~~~~
src/modules/catalog/services/product.service.ts:138:24 - error TS2339: Property 'define' does not exist on type 'AgendaService'.
138 this.agendaService.define(
~~~~~~
src/modules/catalog/services/product.service.ts:143:24 - error TS2339: Property 'every' does not exist on type 'AgendaService'.
143 this.agendaService.every('6 hours', this.AGENDA_JOB_NAME);
~~~~~
[2:31:51 PM] Found 3 errors. Watching for file changes.