出现在AppModule的NgModule.imports中,但在Angular 10中无法解析为NgModule类

时间:2020-07-15 16:24:22

标签: javascript angular

我想安装angular-confirmation-popover,但是如果将其添加到模块的imports部分中,则会出现此错误:

ERROR in node_modules/angular-confirmation-popover/lib/confirmation-popover.module.d.ts:5:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (angular-confirmation-popover) which declares ConfirmationPopoverModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

5 export declare class ConfirmationPopoverModule {
                       ~~~~~~~~~~~~~~~~~~~~~~~~~

该库为updated to Angular 10,因此错误必须在我这一边。我安装了最新的6.0.0版本。

如何调试这样的错误?如果我用"aot": false关闭了Ivy,那么它就可以了,但是我想避免这样做,因为我需要aot来进行生产构建。

0 个答案:

没有答案