2016-12-25 79 views
5

我在的package.json下面的代碼:如何獲取兼容的Angular 2模塊的版本列表?

"dependencies": { 
    "@angular/common": "~2.0.1", 
    "@angular/compiler": "~2.0.1", 
    "@angular/core": "~2.0.1", 
    "@angular/forms": "~2.0.1", 
    "@angular/http": "~2.0.1", 
    "@angular/platform-browser": "~2.0.1", 
    "@angular/platform-browser-dynamic": "~2.0.1", 
    "@angular/router": "~3.0.1", 
    "@angular/upgrade": "~2.0.1", 
    "angular-in-memory-web-api": "~0.1.1", 
    "bootstrap": "^3.3.7", 
    "core-js": "^2.4.1", 
    "reflect-metadata": "^0.1.8", 
    "rxjs": "5.0.0-beta.12", 
    "systemjs": "0.19.39", 
    "zone.js": "^0.6.25" 
    }, 

我從一個教程中獲得了該文件。現在我看到我需要轉移到後來的Angular 2版本。據說在Angular 2項目頁面上,2.4.0是最新的Angular 2版本。這很好 - 但我如何獲得2.4.0兼容的所有必需模塊的版本?例如。我有3.0.1的路由器和2.0.1的常見。新版本號應該是什麼?

回答

6

除路由器之外的所有角度模塊都有相同的版本號,路由器通常具有相同的次要版本和補丁版本,即角度2.0.1 =>路由器3.0.1。

一般情況下,你可以找到相應的node_modules版本/ @角/ [核心|路由器| ...] /的package.json

@角/核心2.4.1:

"peerDependencies": { "rxjs": "^5.0.1", "zone.js": "^0.7.2" }

@角/路由器3.4.1:

"peerDependencies": { "@angular/core": "2.4.1", "@angular/common": "2.4.1", "@angular/platform-browser": "2.4.1", "rxjs": "^5.0.1" }

相關問題