Note: This article was published on 10/08/2024.
This is a seres of articles about Angular Installation, Upgrading.
- Angular Installation and Environment Setup
- Update Angular For Environment And Project
- Update nx-angular:
- Update nx-Angular from 12 to 17 (1) --- Initial Point
- Update nx-Angular from 12 to 17 (2) --- in a nx environment
- Update nx-Angular from 12 to 17 (3) --- to Latest or Version by Version? --- this article
- Update nx-Angular from 12 to 17 (4) --- Debugging (1)
- Update nx-Angular from 12 to 17 (5) --- Debugging (2)
- Update nx-Angular from 12 to 17 (6) --- .Net updating and Angular updating
A - Introduction
This article is to discuss the upgrading approaches for an Angular app in a nx environment.
The content of this article:
- A - Introduction
- B - Two Approaches to Update an Angular App in nx environment
- C - Update to Latest Vertion
- D - Update version by version
B - Two Approaches to Update an Angular App in nx environment
As we discussed in the previous article, Update Angular from 12 to 17 (2) --- in a nx environment,
- An Angular app developed in a nx environment, cannot be updated by updating Angular, but by nx
- The updating procedure should follow the instruction
- npx nx migrate latest (or certain version): Updates dependencies in package.json and generates a migrations.json file
- npm install: Installs the new dependencies
- npx nx migrate --run-migrations: Executes the migration scripts based on migrations.json
From the video Automate Updating Dependencies | Nx, although upgrade version by version is suggested, but in nx, there is a choice that one can upgrade the app from lower version to the latest directly. Let us try first.
C - Update to Latest Vertion
We started from the environment:

Step 1: Run the command
npx nx migrate latest
We got:

This step will create two files:
- pachage.json
- migration.json

In the Package.json file, we can see the version upgrading:
Angular from 12.1.0 upgraded to 18.2.6

nx is upgraded from 12.8.0 to 18.8.2

Step 2: run command to install libraries:










Join the conversation! Your thoughts help the community grow.