Installing Angular 5 without the CLI. The Angular Quickstart page allows you to download a zip file containing the basic structure of an Angular 5 project. Once downloaded, extract all of the folders and file to a new project folder. Then, once in the directory within your console or command line, type: $. Sudo npm install-g @angular/cli@latest. If any how you are seeing the old version, try the below command. Ng update @angular/cli. It’s time to check out your Angular CLI version, hit the below command. Once you are done updating both global and local packages, use the below command to clear the cache to get rid from the errors.
Download Angular Cli Windows 10
Angular 10.0.0 is finally here. While upgrading to Angular 10 version remember few things before running ng update
command.
- Its always advisable to update your app to its next major version.
- That is if you are using Angular 7 or Angular 8 or Angular 6,5, 4 etc versions, Do not try to update to Angular 10 Directly.
- First Update your Angular app to Angular 9.
- Then use
ng update
command.
On June 25, 2020 Angular version 10.0.0 is released.
The latest Official stable version is Angular 10.1.2 which is released on 16th September 2020.
Angular 10 version one of the major release after version 9 which was released 4 monthsago.
As I said above, Updating to Angular 10 is easy If your application using Angular 9 version.
Just update @angular/core and @angular/cli by using ng update
command.
If you are using Angular material You have to update it as well using ng update
command.
If you are using older versions other than 9. First better to update to Angular 9 as mentioned below.
Steps to upgrade Angular application are same across the operating systems like Windows OS,MacOS and Linux OS or Unix based machines. Download old office for mac.
Angular 11 is in pre release state. You can read more about Angular 11Angular 11 Release date, features & update to Angular 11 version
Major breaking changes in Angular 10 version
- Angular 10 supports only typescript 3.9. We have to update Typescript to version 3.9. Typescript versions 3.6, 3.7, and 3.8 are no longer supported.
- In earlier versions of angular input field of type number used to fire valueChanges two times. First time after typing in the input field and second time when the input field loses the focus. (PR 36087)
- The minLength and maxLength validators now verify that a value has numeric length property and only then validation will occur.(PR 36157)
- in Angular 10,The Warnings about unknown elements are now logged as errors instead of warnings (console.warn to console.error)(PR 36399)
- In previous versions of angular if you return null for UrlMatchResult we used to get
Type 'null' is not assignable to type 'UrlMatchResult'.
error. This has been fixed now(PR 36402) - In Angular 10 version transplanted views will refresh only at the insertion location in Ivy.(PR 35968)
- If you try to use
formatDate
or DatePipe with the “B” or “b” format codes (“at night”, “in the morning”, etc.), This does not work for locale “en” (and sublocales) between 21:00 and 06:00. Instead of getting “at night”, you’ll get “AM/PM”.In the older versions the code was not able to handle period of time that crossed midnight. This is fixed as part of (PR 36611) - When an angular route has at least two resolvers, and if any resolver resolves to empty, navigation will be canceled, as it is the behaviour for a single resolverand if all resolvers resolve to empty, the router will not throw any errors. earlier it used to emit uncaught errors (PR 24621)
New Angular 10 projects use the filename .browserslistrc
instead of browserslist
. And ng update
will migrate it automatically if your updating from older versions.
Angular 10 recommends the use of a tsconfig.base.json
to help organize the various typings contexts (shared, unit tests, end to end tests, application, etc). ng update will migrate your project automatically.
I updated a sample Angular application to Angular 10 (Which is in version Angular 9).
Updating to Angular 10 is pretty much simple. You can see the version update log below.
Angular 10 Update Log
To update the Angular CLI to latest version 9 follow the below steps.
First update the local angular cli to version 8.3.17 or 8.x version by using below command.
After updating angular cli to version 8 and above, use the below command to update angular cli to version 9
As Angular 9 is in RC period, the flag --next
is required while using ng update
command. This flag is not required, once final version of Angular 9 is released.
As there are some breaking changes are coming in Angular 9
The above commands will run a series of small migrations that will convert the code of your application to be compatible with version 9 as shown below.
Angular version 10.1.2
After releasing Angular 10 version, Angular team at google releasing small minor versions of Angular which fixes few existing bugs and minor features.
As part of this on 16th September 2020, Angular version 10.1.2 released.
I will be listing down the bug fixes and features of this current release.
Bug Fixes
- @angular/compiler: Detecting Pipes in International Components for Unicode(ICUs) in template binder. #38810
- @angular/core: Clearing the
RefreshTransplantedView
when detached #38768 - @angular/localize: Making
formatOptions
argument is optional for some lower level APIs used by CLI. #38787 - @angular/router : This bug fix ensure routes are processed in priority order and only if needed. #38780
- @angular/upgrade: Add try/catch when downgrading injectables. #38671
Performance Improvements
Improvements in @angular/compiler-cli package
- A patch related to AOT compilation optimization,emit directive/pipe references that are used
- Optimizing computation of type-check scope information.
The information related to above two improments can be found in below link#38843
Improvements in @angular/ngcc package
- Introduce cache for sharing data across entry-points
- Reduce maximum worker count
The information related to above two improments can be found in below link#38840
Angular version 9.0.0-rc.10 released
On January 22, 2020 Angular version 9.0.0.-rc.10 is released.
To update angular version to 9.0.0-rc.10 use the below command
You can see following message in command prompt
Make sure you update the angular project to version 9 as explained above, before upgrading to Angular version 9.0.0-rc.10.
As it’s pointing out we need to upgrade @angular/cli and @angular/core to 9.0.0-rc.10 version.
Use the below command to update them as well
Angular Cli Command
Angular 9 Released
On february 7 2020 The Angular 9 version released.
To update to angular 9 version use the below command.
If everything is ok then you can see following message in console
As the final version angular 9 is released. It is not required to use –next flag.
If you are using older versions of Angular like 5 or 6 or 7. You need to follow some additional steps as shown below.
Angular CLI version check
To check the Angular CLI version use to below command
ng -version
Update Angular CLI version Globally
To update Angular CLI version globally in your system use the below commands
First you need to uninstall the existing angular cli packages followed by npm cache verify command to clear the cache related problems.
And the install the Angular CLI version again by using npm install -g @angular/cli@latest
If you are using MAC or linux systems you might need to add the prefix sudo before npm
Your global Angular CLI version is greater than your local version.The local Angular CLI version is used
After updating Angular CLI globally you might get this warning if your local project’s angular cli version less than the global angular cli version.
As local packages have more priority than global packages you will get Your global Angular CLI version is greater than your local version.The local Angular CLI version is used warning.
So mostly you need to update your local Angular CLI version as well
Update Angular CLI version Locally
To update Angular CLI version in your local projects use the following commands.
How To Install Angular Cli
Navigate to your local Angular project folder and execute the below commands.
Update Angular CLI version to 6
If you are migrating from older versions of Angular CLI like 1.x to latest Angular version 6.
You need to do few additional checks apart from the above commands.
First you need to convert “angular-cli.json” file in older Angular CLI version to the latest “angular.json” file used in version 6.
To convert “angular-cli.json” file, use the following command
To convert angular-cli.json file pass the current version to ng update by using from flag and additionally use –migrate-only. The migrate only flag makes sure that it will do only a migration but does not update the Angular CLI.
And if you RxJs you need to update it as well use the below command
ng update rxjs
It will update the RxJs version to 6. To support older RxJs imports the above command automatically installs the rxjs-compat package. If you get any error try manual installation.
And Angular CLI version 6 no longer uses intl in _polyfills.ts. _You can remove the below lines from polyfills.ts
And additionally you need to update the @angular core modules as well
ng update @angular/core
Update Angular CLI version to 7
Update Angular Cli
Once you upgraded to Angular CLI version 6. Its very easy to update it to the current latest Angular CLI version 7.
To update Angular CLI version to 7. Just run the following commands
ng update @angular/cli @angular/core
The above command updates Angular cli as well as angular core packages.
In addition to that you can refactor the TypeScript code so that it does not depend on rxjs-compat modules(as explained above).
To refactor TypeScript code run following command
Once all of your dependencies have updated to latest RxJS 6, remove rxjs-compat package as it increases bundle size.
npm uninstall rxjs-compat
ng update @angular/cli not working
If you follow the above steps carefully mostly Angular cli version will be updated without any problems. And do not forgot to add @latest suffix.
ng update @angular/cli@latest