DEV Community

Discussion on: Upgrading to Angular 6!

Collapse
 
chiangs profile image
Stephen Chiang

A quick update: I just successfully updated an production Angular v4.0.0 web application to 6. Here are all the steps I took:

This application did not use Angular Material.

I used the following as a checklist:

After updating my CLI and ensuring I'm on Node v8 or higher globally, I started updating the local package.

  1. create a branch in case it doesn't work I can just abandon it. git checkout -b ng6Update

The from within the project root directory:

  1. npm install @angular/cli
  2. ng update @angular/cli
  3. ng update @angular/core
  4. ng update

Refresh the tree view in VS Code to make sure the angular_cli.json was converted to angular.json.

  1. I decided to go the intermediary route and install the rxjs6 compat file with npm i rxjs-compat

If you used ngRedux...

  1. Because this was an Angular 4 project, the ng-redux library being used (/store@v6) needed to be changed (/store@v7 or latest): npm i @angular-redux/store@latest

  2. Just to be sure I ran: ng update again and received an all good message.

  3. ng serve showed me one minor error which was due to an unused import so I just removed it.

I'm still doing testing on all the functionalities as it's a pretty big application, but so far so good!

Remember to periodically check the package.json during the update process to make sure the changes are shown or just run ng-v and try some of the solutions in the comments of this post. The other thing you can try is manually updating the version numbers in the package.json and ng update: