1

I tried following an online tutorial from the following link : Bootstrap in Angular

I get the following warnings when running npm install --save @ng-bootstrap/ng-bootstrap :

npm WARN codelyzer@3.2.2 requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <5.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @ng-bootstrap/ng-bootstrap@1.0.0-beta.5 requires a peer of @angular/core@^4.0.3 but none is installed. You must install peer dependencies yourself. npm WARN @ng-bootstrap/ng-bootstrap@1.0.0-beta.5 requires a peer of @angular/common@^4.0.3 but none is installed. You must install peer dependencies yourself.

Checking my package.json file these are the dependencies generated :

`"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.5",
"core-js": "^2.4.1",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},

"devDependencies": {
"@angular/cli": "1.5.0",
"@angular/compiler-cli": "^5.0.0",
"@angular/language-service": "^5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.2.0",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.7.0",
"typescript": "~2.4.2"
 }

I have Angular CLI 1.5.0 Node: 8.9.1 Os: win32 x64 angular : 5.0.0

How do I resolve this ? Do I change the dependencies versions ? Or is there another way?

If running npm install on the missing dependencies, the package.json file still has the same version values for @angular/core and others as I assume those are the latest

  • Is this causing an actual problem besides the warning from NPM? – Matt Holland Nov 15 '17 at 23:19
  • Possible duplicate of [How to solve npm UNMET PEER DEPENDENCY](https://stackoverflow.com/questions/35738346/how-to-solve-npm-unmet-peer-dependency) – Matt Holland Nov 15 '17 at 23:20
  • Yes, when running ng serve it says that ' You seem to not be depending on @angular/core" . This is an error –  Nov 15 '17 at 23:25
  • @MattHolland I tried the solutions in the duplicate link that you provided, but ti did not resolve my issues. When running npm install on the missing dependencies, they get installed ` "@angular/core": "^5.0.0",` example, version that I had in the package.json and I still get the same warnings and errors when running it again –  Nov 15 '17 at 23:35
  • unfortunately I don't have any more suggestions! Hopefully ng-bootstrap is updated soon to support Angular 5 (There is a PR open on their GitHub right now). – Matt Holland Nov 16 '17 at 01:00

1 Answers1

1

Use:

"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.7"

And then npm i. This should fix the unmeet dependencies.

See the latest release from their github

oschvr
  • 422
  • 7
  • 15