ng-bootstrap.js ng-bootstrap Angular 错误 6
Error in ng-bootstrap.js ng-bootstrap Angular 6
我刚刚在我的 Angular 项目中安装了 ng-bootstrap,然后我包含了它的模块。但是我的 CLI 显示错误。
"WARNING in
./node_modules/@ng-bootstrap/ng-bootstrap/fesm5/ng-bootstrap.js
9853:57-75 "export 'ɵɵdefineInjectable' was not found in
'@angular/core'"
app.module
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import {NgbPaginationModule, NgbAlertModule} from '@ng-bootstrap/ng-bootstrap';
@NgModule({
imports: [
CommonModule,
NgxPaginationModule,
NgbModule,
NgbPaginationModule,
NgbAlertModule,
RouterModule.forChild(routes)
],
Package.json
{
"name": "eastlaw",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.10",
"@angular/cdk": "^8.0.1",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^8.0.1",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@ng-bootstrap/ng-bootstrap": "^5.0.0-rc.0",
"@ngx-loading-bar/router": "^4.2.0",
"core-js": "^2.5.4",
"jquery": "^3.4.1",
"ng2-slim-loading-bar": "^4.0.0",
"ngx-pagination": "^4.0.0",
"ngx-slick": "^0.2.1",
"ngx-slick-carousel": "^0.4.4",
"npm": "^6.9.2",
"rxjs": "6.0.0",
"rxjs-compat": "^6.5.2",
"slick-carousel": "^1.8.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.0",
"@angular/cli": "~6.1.5",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}
}
如果您 运行 是 Angular 6 应用程序,请确保您已安装 ng-bootstrap 3.x.x。如果您确实需要使用特定版本的 ng-bootstrap,请考虑升级您的 Angular 版本。
有关兼容性的更多详细信息,请查看 docs.
更新您的 angular CLI 以获得 ng-bootstrap[= 的 Angular 和 Bootstrap CSS 的最低要求版本列表13=]
ng update @angular/cli @angular/core
转到此页面并阅读依赖项
https://ng-bootstrap.github.io/#/getting-started#installation
检查您的 angular 版本
ng -v
我刚刚在我的 Angular 项目中安装了 ng-bootstrap,然后我包含了它的模块。但是我的 CLI 显示错误。
"WARNING in ./node_modules/@ng-bootstrap/ng-bootstrap/fesm5/ng-bootstrap.js 9853:57-75 "export 'ɵɵdefineInjectable' was not found in '@angular/core'"
app.module
import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
import {NgbPaginationModule, NgbAlertModule} from '@ng-bootstrap/ng-bootstrap';
@NgModule({
imports: [
CommonModule,
NgxPaginationModule,
NgbModule,
NgbPaginationModule,
NgbAlertModule,
RouterModule.forChild(routes)
],
Package.json
{
"name": "eastlaw",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.10",
"@angular/cdk": "^8.0.1",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^8.0.1",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@ng-bootstrap/ng-bootstrap": "^5.0.0-rc.0",
"@ngx-loading-bar/router": "^4.2.0",
"core-js": "^2.5.4",
"jquery": "^3.4.1",
"ng2-slim-loading-bar": "^4.0.0",
"ngx-pagination": "^4.0.0",
"ngx-slick": "^0.2.1",
"ngx-slick-carousel": "^0.4.4",
"npm": "^6.9.2",
"rxjs": "6.0.0",
"rxjs-compat": "^6.5.2",
"slick-carousel": "^1.8.1",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.0",
"@angular/cli": "~6.1.5",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}
}
如果您 运行 是 Angular 6 应用程序,请确保您已安装 ng-bootstrap 3.x.x。如果您确实需要使用特定版本的 ng-bootstrap,请考虑升级您的 Angular 版本。 有关兼容性的更多详细信息,请查看 docs.
更新您的 angular CLI 以获得 ng-bootstrap[= 的 Angular 和 Bootstrap CSS 的最低要求版本列表13=]
ng update @angular/cli @angular/core
转到此页面并阅读依赖项 https://ng-bootstrap.github.io/#/getting-started#installation
检查您的 angular 版本
ng -v