简体   繁体   English

Angular 2升级到RC 5-未满足的对等依赖

[英]Angular 2 upgrade to rc 5 - unmet peer dependencies

I need to upgrade my angular to rc5 to use NgModule. 我需要将我的angular升级到rc5才能使用NgModule。

I have followed directions from Angular 2 . 我遵循了Angular 2的指示

I have updated my package.json dependencies to this and then ran npm stall in the terminal: 我已经将package.json依赖项更新为此,然后在终端中运行npm档:

  "dependencies": {
    "@angular/common": "^2.0.0-rc.5",
    "@angular/compiler": "^2.0.0-rc.5",
    "@angular/core": "^2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "^2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "^2.0.0-rc.5",
    "@angular/router": "3.0.0-beta.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",
    "angular2-google-maps": "^0.12.0",
    "angular2-in-memory-web-api": "0.0.14",
    "bootstrap": "^3.3.6",
    "core-js": "^2.4.0",
    "jquery": "v3.1.0",
    "ng2-select": "^1.0.3",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.6",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.12"
  },

terminal results: 最终结果:

Benjamins-MacBook-Pro:the-vegan-repository Ben$ npm install

> the-vegan-repository@1.0.0 postinstall /Users/Ben/Development/the-vegan-repository
> typings install

typings WARN deprecated 7/26/2016: "registry:dt/core-js#0.0.0+20160602141332" is deprecated (updated, replaced or removed)
typings WARN deprecated 8/7/2016: "registry:dt/node#6.0.0+20160621231320" is deprecated (updated, replaced or removed)

├── core-js (global)
├── jasmine (global)
└── node (global)

npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/common@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/compiler@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/core@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser-dynamic@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of es6-shim@^0.35.0 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/core@2.0.0-rc.4 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/http@2.0.0-rc.4 but none was installed.
npm WARN EPACKAGEJSON the-vegan-repository@1.0.0 No repository field.

I have tried the other option suggested by Angular 2: 我尝试了Angular 2建议的其他选择:

npm install @angular/{core,common,compiler,platform-browser,platform-browser-dynamic} --save

results: 结果:

Benjamins-MacBook-Pro:the-vegan-repository Ben$ npm install @angular/{core,common,compiler,platform-browser,platform-browser-dynamic} --save
the-vegan-repository@1.0.0 /Users/Ben/Development/the-vegan-repository
├── 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/http@2.0.0-rc.5
├── UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0-rc.5
├── UNMET PEER DEPENDENCY @angular/platform-browser-dynamic@2.0.0-rc.5
└── UNMET PEER DEPENDENCY es6-shim@^0.35.0

npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/common@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/compiler@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/core@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser-dynamic@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of es6-shim@^0.35.0 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/core@2.0.0-rc.4 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/http@2.0.0-rc.4 but none was installed.
npm WARN EPACKAGEJSON the-vegan-repository@1.0.0 No repository field.
npm ERR! code 1

No matter what I do to upgrade, I get the same unmet peer dependencies errors. 无论我做什么升级,都会遇到相同的未满足的对等依赖错误。

To fix that I have tried: 要解决我尝试过的问题:

npm install @angular npm install @角度

result: 结果:

Benjamins-MacBook-Pro:the-vegan-repository Ben$ npm install @angular
npm ERR! addLocal Could not install /Users/Ben/Development/the-vegan-repository/@angular
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "@angular"
npm ERR! node v5.3.0
npm ERR! npm  v3.3.12
npm ERR! path /Users/Ben/Development/the-vegan-repository/@angular
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open

npm ERR! enoent ENOENT: no such file or directory, open '/Users/Ben/Development/the-vegan-repository/@angular'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/Ben/Development/the-vegan-repository/npm-debug.log

npm install @angular/common npm install @ angular / common

result: 结果:

Benjamins-MacBook-Pro:the-vegan-repository Ben$ npm install @angular/common
the-vegan-repository@1.0.0 /Users/Ben/Development/the-vegan-repository
├── 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/http@2.0.0-rc.5
├── UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0-rc.5
├── UNMET PEER DEPENDENCY @angular/platform-browser-dynamic@2.0.0-rc.5
└── UNMET PEER DEPENDENCY es6-shim@^0.35.0

npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/common@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/compiler@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/core@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser-dynamic@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of es6-shim@^0.35.0 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/core@2.0.0-rc.4 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/http@2.0.0-rc.4 but none was installed.
npm WARN EPACKAGEJSON the-vegan-repository@1.0.0 No repository field.
npm ERR! code 1

npm install @angular/common@2.0.0-rc.5 npm安装@ angular / common @ 2.0.0-rc.5

result: 结果:

Benjamins-MacBook-Pro:the-vegan-repository Ben$ npm install @angular/common@2.0.0-rc.5
the-vegan-repository@1.0.0 /Users/Ben/Development/the-vegan-repository
├── 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/http@2.0.0-rc.5
├── UNMET PEER DEPENDENCY @angular/platform-browser@2.0.0-rc.5
├── UNMET PEER DEPENDENCY @angular/platform-browser-dynamic@2.0.0-rc.5
└── UNMET PEER DEPENDENCY es6-shim@^0.35.0

npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/common@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/compiler@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/core@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/platform-browser-dynamic@2.0.0-rc.2 but none was installed.
npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of es6-shim@^0.35.0 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/core@2.0.0-rc.4 but none was installed.
npm WARN EPEERINVALID angular2-in-memory-web-api@0.0.14 requires a peer of @angular/http@2.0.0-rc.4 but none was installed.
npm WARN EPACKAGEJSON the-vegan-repository@1.0.0 No repository field.
npm ERR! code 1

Note that this is a working angular 2 app so I do seem to have angular 2 installed. 请注意,这是一个正常工作的angular 2应用程序,因此我似乎确实安装了angular 2。 How do I meet my peer dependencies so that I can upgrade to angular2 rc5? 如何满足对等方的依赖性,以便可以升级到angular2 rc5?

Have you tried a fresh npm install ? 您是否尝试过全新的npm install Definitely would recommend. 绝对会推荐。 Also try to clean the cache beforehand to ensure you have no prior conflicts: 另外,请尝试事先清除缓存,以确保您之前没有冲突:

rm -rf node_modules/
npm cache clean
npm install

Also I'd recommend updating your router to 3.0.0-rc.1 . 另外,我建议您将路由器更新为3.0.0-rc.1 That's the most recent version. 那是最新版本。

EDIT: I'd also recommend just deleting your node_modules directory and getting a fresh one with the install: rm -rf node_modules . 编辑:我也建议您只删除您的node_modules目录,并通过安装获得一个新目录: rm -rf node_modules

the reason you are getting this error is because you are using "angular2-google-maps": "^0.12.0" along with angular2. 您收到此错误的原因是因为您正在使用"angular2-google-maps": "^0.12.0"以及angular2。 now "angular2-google-maps" is peer dependent on angular 2.0.0-rc.2 version that's what the error states : 现在"angular2-google-maps"是对等的,依赖于angular 2.0.0-rc.2版本,这是错误所指出的:

npm WARN EPEERINVALID angular2-google-maps@0.12.0 requires a peer of @angular/common@2.0.0-rc.2 but none was installed.

this is still an open issue as seen here . 这仍然是一个开放的问题,因为看到这里

  • I would suggest you to either use angular 2.0.0-rc.2 till it gets resolved. 我建议您要么使用angular 2.0.0-rc.2直到解决。
  • Second would be to use npm i https://github.com/SebastianM/angular2-google-maps/tarball/0.12.0 --save for installation of google-maps. 第二个方法是使用npm i https://github.com/SebastianM/angular2-google-maps/tarball/0.12.0 --save来安装google-maps。

hope it helps! 希望能帮助到你!

EDIT : they are releasing 0.13.0 version which would be compatible with rc5 in couple of days. 编辑:他们正在发布0.13.0版本,它将在几天之内与rc5兼容。 for more info look here 欲了解更多信息,请点击这里

如果您仍然遇到问题,请尝试

npm --depth Infinity update

Here is the same issue which I was also facing- 这也是我同样面临的问题-

I just update npm- 我只是更新npm-

sudo npm install npm -g

My issue got resolved !!! 我的问题解决了!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM