2016-08-20 104 views
2

一直試圖在Webstorm中設置我的Angular2應用程序,並遇到npm install的問題,因爲'[email protected]'具有未滿足的對等關係。我試圖手動安裝它未滿足的對等依賴原因

 sudo npm install [email protected] 

但它不起作用。這是試圖NPM安裝在終端輸出:

 sudo npm install 
     [email protected] /home/chase/angular2-starter 
     ├── [email protected] extraneous 
     └── UNMET PEER DEPENDENCY [email protected] 

     npm WARN optional Skipping failed optional dependency /chokidar/fsevents: 
     npm WARN notsup Not compatible with your operating system or architecture: [email protected] 
     npm WARN [email protected] requires a peer of [email protected] but none was installed. 
     npm WARN [email protected] No description 
     npm WARN [email protected] No repository field. 

這是我的package.json文件:

{ 
     "name": "angular2-starter", 
     "version": "1.0.0", 
     "scripts": { 
     "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ", 
     "lite": "lite-server", 
     "postinstall": "typings install", 
     "tsc": "tsc", 
     "tsc:w": "tsc -w", 
     "typings": "typings" 
    }, 
     "license": "ISC", 
     "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-rc.1", 
     "@angular/router-deprecated": "2.0.0-rc.2", 
     "@angular/upgrade": "2.0.0-rc.5", 
     "angular2": "^2.0.0-beta.17", 
     "angular2-in-memory-web-api": "0.0.15", 
     "bootstrap": "^3.3.6", 
     "core-js": "^2.4.0", 
     "es6-shim": "^0.35.1", 
     "reflect-metadata": "^0.1.2", 
     "rxjs": "^5.0.0-beta.6", 
     "systemjs": "0.19.27", 
     "zone.js": "^0.6.15" 
     }, 
     "devDependencies": { 
     "concurrently": "^2.0.0", 
     "lite-server": "^2.2.0", 
     "typescript": "^1.8.10", 
     "typings": "^1.0.4" 
    } 
    } 

什麼想法?謝謝

回答

2

npm WARN [email protected] requires a peer of [email protected] but none was installed.表示您需要正確的版本,並且沒有安裝它。您可以通過更正package.json在版本之前沒有插入符號(^)來更改此設置。

"reflect-metadata": "0.1.2", 
    "rxjs": "5.0.0-beta.6", 

刪除脫字符將安裝特定版本。但是這會阻止正在安裝的更新版本。

+0

是的,基本上你已經安裝了依賴關係,但比指定的更新。所以是的,刪除脫字符(^)將安裝特定的版本,你不會得到任何警告。 –

+0

正確,這應該解決當前庫更新比需要它的模塊更新的問題。在某些時候,原始安裝(角度)應該更新爲使用更新的版本,並且可以返回脫字符(^)。 –