Angular2:UNMET PEER DEPENDENCY

时间:2016-09-07 05:37:38

标签: angular ng2-bootstrap

我正在尝试使用此命令

在Angular2中使用npm安装bootstrap
  

npm install --save ng2-bootstrap

但我在控制台

中收到错误和警告
xz compression not available

1 个答案:

答案 0 :(得分:2)

您需要将应用程序升级到angular2 RC6版本。

请按照以下步骤进行操作 -

  1. 将package.json中的@angular版本更新为 2.0.0-rc.6 Refer package.json here

  2. 清理node_modules文件夹,然后运行npm install。

  3. 看看这是否有帮助。

    修改

    这是我的package.json在angular2 RC6和ng2-bootstrap 1.1.1中的应用方式与angular-cli

    {
      "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"
      }
    }