4

このコマンドでAngular2でnpmを使用してブートストラップをインストールしようとしています

npm install --save ng2-bootstrap

しかし、コンソールに次のエラーと警告が表示されます

+-- UNMET PEER DEPENDENCY @angular/common@2.0.0-rc.5
+-- UNMET PEER DEPENDENCY @angular/compiler@2.0.0-rc.5
+-- UNMET PEER DEPENDENCY @angular/core@2.0.0-rc.5
+-- UNMET PEER DEPENDENCY @angular/forms@0.3.0
+-- ng2-bootstrap@1.1.1 
`-- UNMET PEER DEPENDENCY webpack@^1.9.11

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or   architecture: fsevents@1.0.14
npm WARN extract-text-webpack-plugin@1.0.1 requires a peer of   webpack@^1.9.11 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/common@2.0.0-rc.6 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/compiler@2.0.0-rc.6 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/core@2.0.0-rc.6 but none was installed.
npm WARN ng2-bootstrap@1.1.1 requires a peer of @angular/forms@2.0.0-rc.6 but none was installed.
4

1 に答える 1

2

アプリケーションを angular2 RC6 バージョンにアップグレードする必要があります。

次の手順を実行します-

  1. package.json で @angular のバージョンを2.0.0-rc.6に更新します。ここで package.jsonを参照してください。

  2. node_modules フォルダーを消去してから、npm install を実行します。

これが役立つかどうかを確認してください。


編集:

これは、angular-cli を使用した angular2 RC6 および ng2-bootstrap 1.1.1 の場合、私の package.json がどのように見えるかです。

{
  "name": "angular2-rc6-cli-ng2bootstrap-8-sep",
  "version": "0.0.0",
  "license": "MIT",
  "angular-cli": {},
  "scripts": {
    "start": "ng serve",
    "postinstall": "typings install",
    "lint": "tslint \"src/**/*.ts\"",
    "test": "ng test",
    "pree2e": "webdriver-manager update",
    "e2e": "protractor"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "2.0.0-rc.6",
    "@angular/compiler": "2.0.0-rc.6",
    "@angular/compiler-cli": "0.6.0",
    "@angular/core": "2.0.0-rc.6",
    "@angular/forms": "2.0.0-rc.6",
    "@angular/http": "2.0.0-rc.6",
    "@angular/platform-browser": "2.0.0-rc.6",
    "@angular/platform-browser-dynamic": "2.0.0-rc.6",
    "@angular/platform-server": "2.0.0-rc.6",
    "@angular/router": "3.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.6",
    "es6-shim": "0.35.1",
    "ng2-bootstrap": "^1.1.1",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.11",
    "systemjs": "0.19.26",
    "zone.js": "^0.6.17"
  },
  "devDependencies": {
    "angular-cli": "1.0.0-beta.10",
    "codelyzer": "0.0.20",
    "ember-cli-inject-live-reload": "1.4.0",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "0.13.22",
    "karma-chrome-launcher": "0.2.3",
    "karma-jasmine": "0.3.8",
    "protractor": "3.3.0",
    "ts-node": "0.5.5",
    "tslint": "3.11.0",
    "typescript": "2.0.2",
    "typings": "1.3.1"
  }
}
于 2016-09-07T05:41:49.590 に答える