From a560aa90cbd7f60e55b9823b1dff009aa44d73c1 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 14 Jul 2026 08:21:07 -0400 Subject: [PATCH 1/2] fix(@angular/cli): revert package.json changes if installation tasks fail during update When running the update command, if package manager installation fails (e.g., due to peer dependency conflicts or network issues), the project's package.json is left in an updated state but node_modules is missing or inconsistent. To prevent leaving the workspace in a broken state, backup the original package.json before applying the update plan, and restore it from the backup if the installation tasks throw an error. --- .../angular/cli/src/commands/update/cli.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/angular/cli/src/commands/update/cli.ts b/packages/angular/cli/src/commands/update/cli.ts index e10ff4b940b8..fc11474cc48a 100644 --- a/packages/angular/cli/src/commands/update/cli.ts +++ b/packages/angular/cli/src/commands/update/cli.ts @@ -541,6 +541,14 @@ export default class UpdateCommandModule extends CommandModule Date: Tue, 14 Jul 2026 10:41:22 -0400 Subject: [PATCH 2/2] refactor(@angular/cli): skip cleaning node_modules for non-npm package managers Other package managers (pnpm, yarn, bun) deterministically reconcile node_modules with the lockfile during installation, making full directory deletion unnecessary and slow. Keep node_modules cleanup only for npm for now. --- packages/angular/cli/src/commands/update/cli.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/angular/cli/src/commands/update/cli.ts b/packages/angular/cli/src/commands/update/cli.ts index fc11474cc48a..b886c287f2ec 100644 --- a/packages/angular/cli/src/commands/update/cli.ts +++ b/packages/angular/cli/src/commands/update/cli.ts @@ -567,6 +567,11 @@ export default class UpdateCommandModule extends CommandModule