【发布时间】:2020-10-25 23:09:36
【问题描述】:
我刚刚使用 Angular CLI 创建了一个全新的 Angular 10 项目,然后在设置了我的初始模块并路由和测试它是否有效之后,我使用以下命令添加了 ng-bootstrap:
ng add @ng-bootstrap/schematics
现在当我尝试 ng serve 我的项目时,我收到以下错误:
Failed to compile entry-point @ng-bootstrap/ng-bootstrap (module as esm5) due to compilation errors:
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.js:148:43 - error NG1006: Cannot combine @Input decorators with query decorators
148 "starTemplate": [{ type: Input }, { type: ContentChild, args: [TemplateRef,] },],
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.module.js:12:51 - error NG6001: The class 'NgbRating' is listed in the declarations of the NgModule 'NgbRatingModule', but is not a directive, a component, or a pipe. Either remove it from the NgModule's declarations, or add an appropriate Angular decorator.
12 { type: NgModule, args: [{ declarations: [NgbRating], exports: [NgbRating], imports: [CommonModule] },] },
~~~~~~~~~
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.js:14:5
14 var NgbRating = /** @class */ (function () {
~~~~~~~~~
'NgbRating' is declared here.
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.js:14:5 - error NG6003: Appears in the NgModule.exports of NgbRatingModule, but could not be resolved to an NgModule, Component, Directive, or Pipe class.
Is it missing an Angular annotation?
14 var NgbRating = /** @class */ (function () {
~~~~~~~~~
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.module.js:7:5 - error NG6002: Appears in the NgModule.imports of NgbRootModule, but itself has errors
7 var NgbRatingModule = /** @class */ (function () {
~~~~~~~~~~~~~~~
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.module.js:7:5 - error NG6003: Appears in the NgModule.exports of NgbRootModule, but itself has errors
7 var NgbRatingModule = /** @class */ (function () {
~~~~~~~~~~~~~~~
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.module.js:7:5 - error NG6002: Appears in the NgModule.imports of NgbModule, but itself has errors
7 var NgbRatingModule = /** @class */ (function () {
~~~~~~~~~~~~~~~
../../node_modules/@ng-bootstrap/ng-bootstrap/rating/rating.module.js:7:5 - error NG6003: Appears in the NgModule.exports of NgbModule, but itself has errors
7 var NgbRatingModule = /** @class */ (function () {
这只是 ng-bootstrap 包中的一个错误,还是我在项目中做错了什么,或者我是如何添加 ng-bootstrap 的?有什么修复它的建议吗?
【问题讨论】:
-
似乎是ng-Bootstrap的问题-github.com/ng-bootstrap/ng-bootstrap/issues/3788
标签: angular ng-bootstrap