Here is an overview of the process for updating to Angular 9.
- Update Angular CLI to version 9
- Baseline Update to Angular 8.x
- Update to Angular 9
- Additional Verification for Update
Detailed steps below.
- Open a terminal window and move into your Angular project directory
cd angular-ecommerce
- To update Angular CLI, you need to update it globally and locally. As a result, you need to run both commands below.
npm install -g @angular/cli
npm install --save-dev @angular/cli@latest
- Verify that you are using Angular CLI version 9. Type the following command
ng version
- In the output, make note of the following line:
Angular CLI: 9.0.1
- First update to the latest 8.x version. Type the following command:
ng update @angular/core@8 @angular/cli@8
- Now update your project to Angular version 9
ng update @angular/core @angular/cli
- During this process you will see status messages such as:
Using package manager: 'npm'
Collecting installed dependencies...
Found 32 dependencies.
Fetching dependency metadata from registry...
Package '@angular/cli' is already up to date.
Updating package.json with dependency @angular/core @ "9.0.0" (was "8.2.14")...
Updating package.json with dependency @angular/compiler-cli @ "9.0.0" (was "8.2.14")...
Updating package.json with dependency @angular/language-service @ "9.0.0" (was "8.2.14")...
Updating package.json with dependency @angular/animations @ "9.0.0" (was "8.2.14")...
Updating package.json with dependency @angular/common @ "9.0.0" (was "8.2.14")...
Updating package.json with dependency @angular/compiler @ "9.0.0" (was "8.2.14")...
Updating package.json with dependency @angular/forms @ "9.0.0" (was "8.2.14")...
...
(note your version numbers may vary)
-
Eventually, you will see the message below letting you know the update is complete.
Your project has been updated to Angular version 9!
- You can also verify the use Angular 9 in your project with this command:
ng version
- In the output, make note of the following line (note your version numbers may vary):
...
Angular: 9.0.0
...
-
You can also verify the Angular version by viewing the
package.json
file. Recall that thepackage.json
file is similar to the Mavenpom.xml
file. -
In your text editor, view the file:
package.json
-
Make note of the dependencies section
...
"dependencies": {
"@angular/animations": "~9.0.0",
"@angular/common": "~9.0.0",
"@angular/compiler": "~9.0.0",
"@angular/core": "~9.0.0",
"@angular/forms": "~9.0.0",
"@angular/platform-browser": "~9.0.0",
"@angular/platform-browser-dynamic": "~9.0.0",
"@angular/router": "~9.0.0",
...
Q: Will this course use Angular 9?
A: Yes, all future videos will use Angular 9.
Q: Does the ecommerce project have any deprecated code?
A: No, the ecommerce project does not have any deprecated code for Angular 9. The project runs on Angular 9 without any deprecated code or warnings.
Q: Where can I find information on all new features in Angular 9?
A: You can view the blog post: Version 9 of Angular Now Available Project Ivy has arrived
Q: Where can I find details on the update/migration process?
A: See the Angular documentation: Updating to Version 9
Q: I have other Angular apps that I need to update, is there an automated tool or website for this?
A: Yes, please see the Angular Update Guide. It provides automation and guidance for updating Angular projects.
For details on using the Angular Update guide, see the Angular Documentation: Keeping your Angular projects up-to-date