我有一些服务,我在构造函数中注入 CACHE_MANAGER
import { CACHE_MANAGER, Inject, Injectable } from '@nestjs/common';
import { Cache } from 'cache-manager';
...
export class ManagerService {
constructor(@Inject(CACHE_MANAGER) private cacheManager: Cache) {}
...
}
Run Code Online (Sandbox Code Playgroud)
当我测试导入这些服务的模块时,这给了我一个错误
Nest can't resolve dependencies of the ManagerService (?). Please make sure that the argument CACHE_MANAGER at index [0] is available in the Web3ManagerService context.
我对 NestJs 比较陌生,所以我真的不知道如何解决它