将angular2 rc6升级到rc7

时间:2016-09-15 22:51:14

标签: npm npm-install

如何将angular2项目从rc6升级到rc7? 经过几个小时的谷歌搜索,我找不到解决方案。

此命令行:

npm update angular2

假设没有可用的更新。

1 个答案:

答案 0 :(得分:3)

第一:官方的2.0.0版本就在那里! :)

要解决您的问题,只需更改您的package.json。

由此:

  "dependencies": {
    "@angular/common": "2.0.0-rc.x",
    "@angular/compiler": "2.0.0-rc.x",
    "@angular/core": "2.0.0-rc.x",
    "@angular/forms": "2.0.0-rc.x",
    "@angular/http": "2.0.0-rc.x",
    "@angular/platform-browser": "2.0.0-rc.x",
    "@angular/platform-browser-dynamic": "2.0.0-rc.x",
    "@angular/router": "3.0.0-rc.x",
    ...
  },

对此:

  "dependencies": {
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.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/router": "3.0.0",
    "core-js": "^2.4.1", // !! UPDATE THESE ENTRIES TOO !!
    "rxjs": "5.0.0-beta.12", // !! UPDATE THESE ENTRIES TOO !!
    "ts-helpers": "^1.1.1", // !! UPDATE THESE ENTRIES TOO !!
    "zone.js": "^0.6.23" // !! UPDATE THESE ENTRIES TOO !!
  },

并在同一目录npm i或长命令npm install

中运行