Angular2:UNMET PEER DEPENDENCY rxjs@5.0.0-rc.4

时间:2016-12-06 10:48:37

标签: node.js angular npm

当我执行npm install时,有人能告诉我为什么npm会收到此消息:

+-- @angular/common@2.2.4
+-- @angular/core@2.2.4
+-- @angular/http@2.2.4
+-- @angular/platform-browser@2.2.4
+-- @types/core-js@0.9.35
+-- UNMET PEER DEPENDENCY rxjs@5.0.0-rc.4
| `-- symbol-observable@1.0.4
`-- zone.js@0.6.26

什么' UNMET PEER DEPENDENCY

packages.json的内容是:

{
...
"dependencies": {
    "@angular/common": "^2.2.4",
    "@angular/core": "^2.2.4",
    "@angular/http": "^2.2.4",
    "@angular/platform-browser": "^2.2.4",
    "rxjs": "^5.0.0-beta.12",
    "zone.js": "^0.6.21"
 }
}

为什么npm尝试解决rxjs@5.0.0-rc.4而不是rxjs@5.0.0-beta.12

1 个答案:

答案 0 :(得分:2)

这是一个有效的package.json

{
  ...
  "dependencies": {
    "@angular/common": "^2.2.4",
    "@angular/core": "^2.2.4",
    "@angular/http": "^2.2.4",
    "@angular/platform-browser": "^2.2.4",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "^0.6.21"
  }
}

只需删除^

即可