NPM不链接对等依赖项

时间:2016-08-19 08:29:15

标签: angular npm npm-install

我的包json是:

 "devDependencies": {
    "@angular/common": "2.0.0-rc.4",
    "@angular/compiler": "2.0.0-rc.4",
    "@angular/core": "2.0.0-rc.4",
    "@angular/http": "2.0.0-rc.4",
    "@angular/platform-browser": "2.0.0-rc.4",
    "@angular/platform-browser-dynamic": "2.0.0-rc.4",
    "@angular/router": "^3.0.0-alpha.8",
    "autoprefixer": "^6.3.3",
   "rxjs": "5.0.0-beta.6",
    "selenium-standalone": "^5.1.0",
    "style-loader": "^0.13.0",
    "stylelint": "^6.3.2",
    "stylelint-webpack-plugin": "^0.2.0",
    "to-string-loader": "^1.1.3",
    "ts-helpers": "^1.1.1",
    "tslint": "^3.3.0",
    "tslint-loader": "^2.1.0",
    "typescript": "^1.8.10",
    "typings": "^1.0.4",
    "webpack": "^1.13.0",
    "webpack-dev-server": "^1.14.1",
    "webpack-hot-middleware": "^2.9.1",
    "webpack-split-by-path": "0.1.0",
    "zone.js": "0.6.12"
  }

当我执行npm安装时,我收到以下错误:

+-- UNMET PEER DEPENDENCY @angular/common@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY @angular/compiler@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY @angular/core@2.0.0-rc.4
+-- @angular/forms@0.2.0 
+-- @angular/http@2.0.0-rc.4 
+-- UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY @angular/platform-browser-dynamic@2.0.0-rc.4
+-- @angular/router@3.0.0-rc.1 

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 @angular/router@3.0.0-rc.1 requires a peer of @angular/core@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/compiler@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/common@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/platform-browser@^2.0.0-rc.5 but none was installed.
npm WARN @angular/router@3.0.0-rc.1 requires a peer of @angular/platform-browser-dynamic@^2.0.0-rc.5 but none was installed.

如果我去核心库并npm list我得到以下内容:

node_modules/@angular/core$ npm list
@angular/core@2.0.0-rc.4
+-- UNMET PEER DEPENDENCY rxjs@5.0.0-beta.6
`-- UNMET PEER DEPENDENCY zone.js@^0.6.6

npm ERR! peer dep missing: rxjs@5.0.0-beta.6, required by @angular/core@2.0.0-rc.4
npm ERR! peer dep missing: zone.js@^0.6.6, required by @angular/core@2.0.0-rc.4

但是已经按照package.json安装了rxjs@5.0.0-beta.6和zone.js@^0.6.6。为什么npm没有将这些库链接到所需的库?

1 个答案:

答案 0 :(得分:0)

您确定所有这些都是devDependencies,而不是需要与应用程序一起部署的依赖项(例如angular)吗?如果你有依赖关系中的角度模块,那么对等体rxjs和zonejs将需要依赖。