角度2 UNMET PEER DEPENDENCY @ angular / common @ 2.4.8

时间:2017-03-02 11:54:17

标签: angular npm npm-install

我是angularjs2中的新手,我想在我的应用程序中实现服务器端数据表,所以为此目的我已经使用

npm install --save ng2-smart-table library

但它会给出错误,如

+-- UNMET PEER DEPENDENCY @angular/common@2.4.8
+-- UNMET PEER DEPENDENCY @angular/compiler@2.4.8
+-- UNMET PEER DEPENDENCY @angular/core@2.4.8
+-- UNMET PEER DEPENDENCY @angular/forms@2.4.8
+-- ng2-smart-table@0.5.3-0 
| `-- ng2-completer@1.2.0 
`-- UNMET PEER DEPENDENCY rxjs@5.2.0

的package.json

{
  "name": "my-app",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/platform-browser": "^2.4.0",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/router": "^3.4.0",
    "angular2-datatable": "^0.5.3",
    "angular2-flash-messages": "^1.0.5",
    "core-js": "^2.4.1",
    "lodash": "^4.17.4",
    "ng2-smart-table": "^0.5.3-0",
    "ngx-uploader": "^2.2.0",
    "rxjs": "^5.1.0",
    "typescript": "^2.0.10",
    "zone.js": "^0.7.6"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0-rc.0",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/lodash": "^4.14.54",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.4.2",
    "typescript": "~2.0.0"
  }
}

所以我该如何解决这个问题呢?我不想减少我的应用版本。

如果你有更好的方法或库来实现服务器数据表,那么请建议我。在我的应用程序中,我使用php作为后端

1 个答案:

答案 0 :(得分:0)

您可以通过安装软件包解决此问题:

npm install @angular/common@2.4.8 @angular/compiler@2.4.8 @angular/core@2.4.8 @angular/forms@2.4.8 rxjs@5.2.0 --save

或者如果你使用纱线。

yarn add @angular/common@2.4.8 @angular/compiler@2.4.8 @angular/core@2.4.8 @angular/forms@2.4.8 rxjs@5.2.0 --save