Commit 5c3101b
committed
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.1 parent c963ecb commit 5c3101b
1 file changed
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
544 | 552 | | |
545 | 553 | | |
546 | 554 | | |
| |||
596 | 604 | | |
597 | 605 | | |
598 | 606 | | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
599 | 617 | | |
600 | 618 | | |
601 | 619 | | |
| |||
0 commit comments