简体   繁体   中英

How to upgrade Angular from V6 to V7 when the latest version is V8?

Usually, I upgrade Angular to the latest version but I have an old app in v6 that I would like to upgrade first to V7 first (which is not the latest).

The Angular documentation is not very clear:

  • Update to V7 of the core framework and CLI by running ng update @angular/cli @angular/core in your terminal.
  • Update to V8 of the core framework and CLI by running ng update @angular/cli @angular/core in your terminal

However ng-update always tries to update to the latest version.

ng update @angular/core@7.0.0 -- or whichever version you want to install.

You can also go into the package.json and update the core to the specific version you want and run npm install

Follow the guide on upgrade.angular.io . You can set your current and desired version to whatever you want it to be. For 6.0 to 7.0 these are the steps at the very minimum:

  1. npm install -g rxjs-tslint
  2. rxjs-5-to-6-migrate -p src/tsconfig.app.json
  3. ng update @angular/cli @angular/core

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM