我在package.json中有以下代码:
"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的常见。新版本号应该是什么?
答案 0 :(得分:6)
除路由器之外的所有角度模块具有相同的版本号,路由器通常具有相同的次要版本和补丁版本,即角度2.0.1 =>路由器3.0.1。
通常,您可以在node_modules / @ angular / [core | router | ...] / package.json
中找到相应的版本。@ angular / core 2.4.1:
"peerDependencies": {
"rxjs": "^5.0.1",
"zone.js": "^0.7.2"
}
@ angular / router 3.4.1:
"peerDependencies": {
"@angular/core": "2.4.1",
"@angular/common": "2.4.1",
"@angular/platform-browser": "2.4.1",
"rxjs": "^5.0.1"
}