Upgrade to Angular 15 | Angular 14 to Angular 15 Application Migration
Step 1: In your Angular application, open your package.json and search for “dependencies”. You will find angular dependencies along with current installed versions.
We will upgrade to Angular v15.2.9. We need to upgrade all of these dependencies one by one. You can follow the commands below sequentially.
npm i @angular/animation@15.2.9
npm i @angular/common@15.2.9
npm i @angular/compiler@15.2.9
npm i @angular/core@15.2.9
npm i @angular/forms@15.2.9
npm i @angular/platform-browser@15.2.9
npm i @angular/platform-browser-dynamic@15.2.9
npm i @angular/router@15.2.9
After running these commands check your package.json file, all the selected dependencies should be upgraded to v15.2.9:
Step 2: Now look for “devDependencies” in the package.json file and upgrade the marked dependencies.
Run the following commands sequentially:
npm i @angular-devkit/build-angular@15.2.9
npm i @angular/cli@15.2.9
npm i@angular/compiler-cli@15.2.9
After running these commands check your package.json file, all the selected dependencies should be upgraded to v15.2.9:
Step 3: Check your installed Node version by “ng version”.
Make sure that you are using a supported version of node.js before you upgrade your application. Angular v15 supports node.js versions: 14.20.x, 16.13.x and 18.10.x.
Download node v16.20.2 from https://nodejs.org/en/about/previous-releases here and install it. (Don’t forget to uninstall the previous version from your computer)
Step 4: Make sure that you are using a supported version of TypeScript before you upgrade your application. Angular v15 supports TypeScript version 4.8 or later.
Upgrade your typescript version to v4.8.4
npm i typescript@4.8.4
Step 5: Update your “ngx-bootstrap” version to v10.
Run this command to upgrade your ngx-bootstrap version:
Source: https://www.npmjs.com/package/ngx-bootstrap/v/10.3.0
Run this command to upgrade your ngx-bootstrap version:
Finally, check “ng version” again:
If you got any error try to search by the error message and debug again.
Thanks for reading!