【发布时间】:2022-11-10 23:22:42
【问题描述】:
我正在尝试在 Angular 13 中使用 starrating 模块。安装了软件包,但每当我在 AppModule 中调用模块时总是出现以下错误:
'RatingModule' does not appear to be an NgModule class.
rating.module.d.ts(1, 22): This likely means that the library (ng-starrating) which declares
RatingModule 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.
我尝试了一些在互联网上找到的解决方案,但没有一个对我有用,有人遇到过这个错误吗?我感谢您的帮助!
【问题讨论】:
-
尝试运行
npx ngcc或node ./node_modules/.bin/ngcc -
他们都没有工作,还有其他选择吗?
-
ng-starrating的最后一次更新是 3 年前。你确定它仍然与 Angular v13 兼容吗? -
确实,我通过修改 tsconfig.app.json 文件并重新构建项目找到了一种方法,但我不确定这是否是方便的解决方案!
标签: angular