2016-09-21 24 views
0

我剛剛從rc-6升級到角2最終版。我已經在beta/rc版本中多次升級而沒有問題。npm install抱怨已經遇到的未滿足的同級代理

我在我的package.json DEPS是:

"dependencies": { 
    "@angular/common": "2.0.0", 
    "@angular/compiler": "2.0.0", 
    "@angular/compiler-cli": "0.6.0", 
    "@angular/core": "2.0.0", 
    "@angular/forms": "2.0.0", 
    "@angular/http": "2.0.0", 
    "@angular/platform-browser": "2.0.0", 
    "@angular/platform-browser-dynamic": "2.0.0", 
    "@angular/platform-server": "2.0.0", 
    "@angular/router": "3.0.0", 
    "@angular/upgrade": "2.0.0", 
    "angular2-cookie": "1.2.3", 
    "bootstrap-sass": "3.3.6", 
    "chart.js": "2.1.6", 
    "core-js": "^2.4.1", 
    "highlight.js": "9.5.0", 
    "marked": "0.3.5", 
    "ng2-bootstrap": "1.1.1", 
    "ng2-charts": "1.2.0", 
    "reflect-metadata": "^0.1.3", 
    "rxjs": "5.0.0-beta.12", 
    "zone.js": "^0.6.23" 
    } 

這符合什麼是對目前(截至發稿時)angular 2 setup page

運行NPM安裝將安裝一切,但我在最後得到了一堆錯誤:

219946 error code EPEERINVALID 
219947 error peerinvalid The package @angular/[email protected] does not satisfy its siblings' peerDependencies requirements! 
219947 error peerinvalid Peer @angular/[email protected] wants @angular/[email protected]^2.0.0 
219947 error peerinvalid Peer @angular/[email protected] wants @angular/[email protected]^2.0.0 
219947 error peerinvalid Peer @angular/[email protected] wants @angular/[email protected]^2.0.0 
219947 error peerinvalid Peer @angular/[email protected] wants @angular/[email protected]^2.0.0 
219947 error peerinvalid Peer @angular/[email protected] wants @angular/[email protected]^2.0.0 
219947 error peerinvalid Peer [email protected] wants @angular/[email protected] 
219947 error peerinvalid Peer [email protected] wants @angular/[email protected] 
219948 verbose exit [ 1, true ] 

正如你可以在我的package.json看到,我在@角/常見@ 2.0。 0,並且沒有比當前可用的版本更高的版本。目前的設置確實是而不是推薦使用^2.0.0,但我試過了,無濟於事。

我也嘗試過在我的整個node_modules目錄下,同時在其他任何地方安裝@ angular/common,都沒有成功。我是愚蠢的還是還有其他事情在這裏?

回答

0

我做了一些測試,能夠重現此錯誤,當我運行npm install只有一個package.json文件。在您的angular 2項目中運行npm install之前,您應該有4個文件。在angular.io你需要複製了以下文件...

-package.json

-tsconfig.json

-typing.json

-systemjs.config.js

將所有這些文件複製到項目中後,再次運行NPM安裝。 (該文件嵌套在標籤只是在教程中的package.json文件以上)

0

要麼東西了故宮:

npm install -g npm 
    npm cache clean 
    npm update -g 
    npm install 

或者,也許是因爲NG2,引導和NG2,圖表前-REQ舊版本@ angular/common有什麼問題呢?嘗試新的版本?:

"ng2-bootstrap": "1.1.5", 
    "ng2-charts": "1.3.0", 
相關問題