我正在尝试将此库https://github.com/flauc/angular2-notifications从 Angular 2+ 迁移到 Angular 9。
最初的错误是关于ModuleWithProviders已成为泛型类型的,所以我修复了它。我还在这里描述了一个错误https://github.com/angular/angular/issues/32352我已修复,require('@angular/compiler-cli');现在我面临另一个错误:
../node_modules/@angular/common/common.d.ts:115:22 - 错误 NG6002:出现在 SimpleNotificationsModule 的 NgModule.imports 中,但无法解析为 NgModule 类
我很难理解发生了什么,因为我以前从未构建过库,而且使用 gulp 构建似乎有点 hacky,因为这一行ngc = require('@angular/compiler-cli/src/main').main引用了一个不属于公共 API 的函数。
编辑:
按照评论中的想法(和我自己的感觉),我尝试在没有 gulp 的情况下构建:
- 创建了一个
angular.json文件 - 分为和
index.ts_public_api.tssimple-notifications.module.ts - 对文件和文件夹结构进行了一些更改
但我仍然有同样的错误......
我的尝试:https ://github.com/youkouleley/angular2-notifications
我尝试使用 构建它ng build,其中的脚本package.json尚未更新

