这个错误是什么
Module.options 只接受 class,且每个 class 必须恰好使用 @Option() 或 @OptionCommand() 一种角色:
@Option必须至少声明一个字段选项,不能包含@Handler;@OptionCommand必须恰好声明一个默认@Handler(),不能包含字段选项、path Handler 或 flag Handler;- Provider 对象与只有
@Injectable()的 class 应放入Module.providers。
details.reason 会区分缺少 option 装饰器或同时声明多种角色,其他 details 会列出无效字段或 Handlers。
如何修复
先判断这个 class 是共享字段、互斥动作还是普通依赖,再分别使用 @Option、@OptionCommand 或 @Injectable 并放入正确的 Module 数组。不要让同一个 class 同时承担多个角色。