ng6+ -> 7.0
Update RxJS (depends on RxJS 6.3)
npm install -g rxjs-tslint
rxjs-5-to-6-migrate -p src/tsconfig.app.json
Remove rxjs-compat
Then update the core packages and Cli:
ng update @angular/cli @angular/core
(Optional: update Node.js to version 10 which is supported in NG7)
ng6+ (Cli 6.0+): features simplified commands
First, update your Cli
npm install -g @angular/cli
npm install @angular/cli
ng update @angular/cli
Then, update your core packages
ng update @angular/core
If you use RxJS, run
ng update rxjs
It will update RxJS to version 6 and install the rxjs-compat
package under the hood.
If you run into build errors, try a manual install of:
npm i rxjs-compat
npm i @angular-devkit/build-angular
Lastly, check your version
ng v
Note on production build:
ng6 no longer uses intl
in polyfills.ts
//remove them to avoid errors
import 'intl';
import 'intl/locale-data/jsonp/en';
ng5+ (Cli 1.5+)
npm install @angular/{animations,common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router}@next [email protected] rxjs@'^5.5.2'
npm install [email protected] --save-exact
Note:
- The supported Typescript version for Cli 1.6 as of writing is up to 2.5.3.
- Using @next updates the package to beta, if available. Use @latest to get the latest non-beta version.
After updating both the global and local package, clear the cache to avoid errors:
npm cache verify (recommended)
npm cache clean (for older npm versions)
Here are the official references:
- Updating the Cli
- Updating the core packages core package.