Skip to content

Upgrade to Angular 22 fails without any details #33460

Description

@mm-jhn

Command

update

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

I am trying to upgrade our Angular 21 app to Angular 22. But the process fails pretty much immediately with an unhelpful error message that does not point to any particular reason and I don't know how to investigate further.

Minimal Reproduction

Run the following command in this repo: https://github.com/mm-jhn/ng22-repro
ng update @angular/core@22 @angular/cli@22
(the first step from https://angular.dev/update-guide?v=21.0-22.0&l=2)

Exception or Error

The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 22.0.4 to perform the update.
An unhandled exception occurred: Process exited with code 1.
See "C:\Users\USERDIR\AppData\Local\Temp\ng-JsGysP\angular-errors.log" for further details.

Contents of logfile:

[error] Error: Process exited with code 1.
    at ChildProcess.<anonymous> (D:\angular-repro\node_modules\@angular\cli\src\package-managers\host.js:65:28)
    at ChildProcess.emit (node:events:509:28)
    at maybeClose (node:internal/child_process:1124:16)
    at ChildProcess._handle.onexit (node:internal/child_process:306:5)

Your Environment

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI       : 21.2.13
Angular           : 21.2.15
Node.js           : 24.18.0
Package Manager   : npm 11.12.1
Operating System  : win32 x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.2.13           │ 21.2.13           │
│ @angular/cli              │ 21.2.13           │ 21.2.13           │
│ @angular/common           │ 21.2.15           │ 21.2.15           │
│ @angular/compiler         │ 21.2.15           │ 21.2.15           │
│ @angular/compiler-cli     │ 21.2.15           │ 21.2.15           │
│ @angular/core             │ 21.2.15           │ 21.2.15           │
│ @angular/forms            │ 21.2.15           │ 21.2.15           │
│ @angular/localize         │ 21.2.15           │ 21.2.15           │
│ @angular/platform-browser │ 21.2.15           │ 21.2.15           │
│ @angular/router           │ 21.2.15           │ 21.2.15           │
│ rxjs                      │ 7.8.2             │ 7.8.2             │
│ typescript                │ 5.9.3             │ 5.9.3             │
│ vitest                    │ 4.1.7             │ 4.1.7             │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Activity

  1. added this to the needsTriage milestone on Jun 25, 2026
  2. jimivdw commented on Jun 25, 2026

    @jimivdw

    Having the same issue, but on a different environment (so posting here to indicate it's likely not environment-dependent):

    
         _                      _                 ____ _     ___
        / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
       / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
      / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
     /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                    |___/
        
    
    Angular CLI       : 21.2.16
    Angular           : 21.2.17
    Node.js           : 24.11.1
    Package Manager   : yarn 4.17.0
    Operating System  : darwin arm64
    
    ┌────────────────────────────────────┬───────────────────┬───────────────────┐
    │ Package                            │ Installed Version │ Requested Version │
    ├────────────────────────────────────┼───────────────────┼───────────────────┤
    │ @angular-devkit/architect          │ 0.2102.16         │ 0.2102.16         │
    │ @angular-devkit/core               │ 21.2.16           │ 21.2.16           │
    │ @angular-devkit/schematics         │ 21.2.16           │ 21.2.16           │
    │ @angular/animations                │ 21.2.17           │ 21.2.17           │
    │ @angular/build                     │ 21.2.16           │ 21.2.16           │
    │ @angular/cdk                       │ 21.2.14           │ 21.2.14           │
    │ @angular/cli                       │ 21.2.16           │ 21.2.16           │
    │ @angular/common                    │ 21.2.17           │ 21.2.17           │
    │ @angular/compiler                  │ 21.2.17           │ 21.2.17           │
    │ @angular/compiler-cli              │ 21.2.17           │ 21.2.17           │
    │ @angular/core                      │ 21.2.17           │ 21.2.17           │
    │ @angular/forms                     │ 21.2.17           │ 21.2.17           │
    │ @angular/language-service          │ 21.2.17           │ 21.2.17           │
    │ @angular/material                  │ 21.2.14           │ 21.2.14           │
    │ @angular/material-date-fns-adapter │ 21.2.14           │ 21.2.14           │
    │ @angular/platform-browser          │ 21.2.17           │ 21.2.17           │
    │ @angular/platform-browser-dynamic  │ 21.2.17           │ 21.2.17           │
    │ @angular/router                    │ 21.2.17           │ 21.2.17           │
    │ rxjs                               │ 7.8.2             │ 7.8.2             │
    │ typescript                         │ 5.9.3             │ 5.9.3             │
    │ zone.js                            │ 0.16.2            │ 0.16.2            │
    └────────────────────────────────────┴───────────────────┴───────────────────┘
    
  3. alan-agius4 commented on Jun 25, 2026

    @alan-agius4
    Collaborator

    I am unable to replicate this based on the reproduction provided.

     $ ng update @angular/core@22 @angular/cli@22
    The installed Angular CLI version is outdated.
    Installing a temporary Angular CLI versioned 22.0.4 to perform the update.
    Using package manager: npm
    Collecting installed dependencies...
    Found 18 dependencies.
    Fetching dependency metadata from registry...
        Updating package.json with dependency @angular/build @ "22.0.4" (was "21.2.13")...
        Updating package.json with dependency @angular/cli @ "22.0.4" (was "21.2.13")...
        Updating package.json with dependency @angular/compiler-cli @ "22.0.2" (was "21.2.15")...
        Updating package.json with dependency @angular/localize @ "22.0.2" (was "21.2.15")...
        Updating package.json with dependency typescript @ "6.0.3" (was "5.9.3")...
        Updating package.json with dependency @angular/common @ "22.0.2" (was "21.2.15")...
        Updating package.json with dependency @angular/compiler @ "22.0.2" (was "21.2.15")...
        Updating package.json with dependency @angular/core @ "22.0.2" (was "21.2.15")...
        Updating package.json with dependency @angular/forms @ "22.0.2" (was "21.2.15")...
        Updating package.json with dependency @angular/platform-browser @ "22.0.2" (was "21.2.15")...
        Updating package.json with dependency @angular/router @ "22.0.2" (was "21.2.15")...
    UPDATE package.json (752 bytes)
    ✔ Cleaning node modules directory
    ⠋ Installing packages
    

    What is failing in this instance is the package manager invocation.

  4. mm-jhn commented on Jun 25, 2026

    @mm-jhn
    Author

    Is there any option I can enable locally to get more info about why the package manager invocation fails? Because NPM by itself works fine. I tried the --verbose flag on ng update, but that did not give any additional info in the log.

  5. jimivdw commented on Jun 25, 2026

    @jimivdw

    Additionally, is there any way to just skip the whole "Installing a temporary Angular CLI versioned 22.0.4 to perform the update."?

    I've been trying to work around that using

    npx @angular/cli@22 update @angular/core@22 @angular/cli@22
    

    unfortunately to no avail.

    The installed Angular CLI version is outdated.
    Installing a temporary Angular CLI versioned 22.0.4 to perform the update.                                                                                                                                                                                                                                                                            
    An unhandled exception occurred: Process exited with code 1.
    See "/private/.../angular-errors.log" for further details.
    
  6. alan-agius4 commented on Jun 25, 2026

    @alan-agius4
    Collaborator

    To bypass the version check, use the NG_DISABLE_VERSION_CHECK=1 environment variable.

  7. mm-jhn commented on Jun 25, 2026

    @mm-jhn
    Author

    I think I figured it out on my machine: the IT department has pushed a global environment variable npm_config_min_release_age=3 to all developer machines (as a mitigation for NPM supply-chain attacks). The CLI tries to install the latest version, but it's newer than (today - 3 days), so NPM refuses to install it.

    If I disable the version check, the upgrade fails at a later step, when the latest packages are installed. Those also fail, because e.g. @angular/build@22.0.4 does not satisfy that constraint:

    npm error notarget No matching version found for @angular/build@22.0.4 with a date before 22.6.2026, 15:03:39
    

    If I set that env var to 0, I can install the packages and the update command runs fine.

    Then the next question is: how can the Angular CLI deal with this to support developers?

    • Should it warn developers that this setting may cause such failures?
    • Should it comply with such a setting and only install packages (both for the temporary CLI and any actual package upgrades) that satisfy such a min-age constraint?
  8. mm-jhn commented on Jun 25, 2026

    @mm-jhn
    Author

    I have searched the issue tracker with this new knowledge and found #33119. The fix for that issue should land in Angular 22.1.

  9. alan-agius4 commented on Jun 25, 2026

    @alan-agius4
    Collaborator

    @mm-jhn, correct the issue you are experiencing has been resolved in version 22.1, which is currently in pre-release.

    You can try updating to the pre-release version by running the following command to see if it fixes the behavior:

    ng update @angular/core@22 @angular/cli@22 --next
    
  10. mm-jhn commented on Jun 25, 2026

    @mm-jhn
    Author

    I'm afraid it doesn't:

    PS D:\angular-repro> ng update @angular/core@22 @angular/cli@22 --next
    The installed Angular CLI version is outdated.
    Installing a temporary Angular CLI versioned 22.1.0-next.1 to perform the update.
    An unhandled exception occurred: Process exited with code 1.
    See "C:\Users\username\AppData\Local\Temp\ng-Qmw1LH\angular-errors.log" for further details.
    
  11. alan-agius4 commented on Jun 25, 2026

    @alan-agius4
    Collaborator

    Ah, right. to consume this fix the local CLI also need to be updated.

    Closing this issue as it has already been addressed. In the meantime, you can use NG_DISABLE_VERSION_CHECK=1 as a temporary workaround.

  12. angular-automatic-lock-bot commented on Jul 26, 2026

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  13. locked and limited conversation to collaborators on Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular/cligemini-triagedLabel noting that an issue has been triaged by geminineeds: repro stepsWe cannot reproduce the issue with the information given

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions