This is how I make it work.
My Environment:
Angular CLI Global : 6.0.0, Local: 1.7.4, Angular: 5.2, Typescript 2.5.3
Note: To enable ng Update
you need to install Angular CLI 6.0 first
npm install -g @angular/cli or npm install @angular/cli
ng update //update Angular Package core/common/complier... to 6.0.0
ng update @angular/cli //change angular-cli.json to angular.json
optional if you have angular-material 5.4.2, ngx-translate 9.1.1, ng-bootstrap/ng-bootstrap 1.1.1:
ng update @angular/material //upgrade to 6.0.1
npm install @ngx-translate/[email protected] --save //upgrade ngX translate to 10.0.1 for Angular 6
5 npm install --save @ng-bootstrap/[email protected] //for ng-bootstrap
If you use Observable and get the error:
ERROR in node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'. node_modules/rxjs/observable/of.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/observable/of'.
Change: import { Observable } from "rxjs/Observable"; import { of } from 'rxjs/observable/of';
To
import { Observable, of } from "rxjs";
Angular CLI issue: https://github.com/angular/angular-cli/issues/10621