Skip to content

v22 ng update failure #33301

@geromegrignon

Description

@geromegrignon

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

v21

Description

By running ng update @angular/core@22 @angular/cli@22 The command fails with different issues based on the package manager.

With pnpm

It firstly update the lock file with these info:

.angular/cache/angular-cli-tmp-packages-bFgCSZ:
    dependencies:
      '@angular/cli':
        specifier: 22.0.0
        version: 22.0.0

Then fails as per Error: Repository is not clean. Please commit or stash any changes before updating..

The issue is that there is a hash into the change, so committing the change and running the command once again.

The repo worskapce does not include any specific rules: https://github.com/realworld-angular/angular-scan-realworld-angular/blob/main/pnpm-workspace.yaml

With npm

Same project:

  • pnpm loc/pnpm workspace/cache/node-modules removed
  • ran npm install (so all dependencies installed properly)

The update fails:

gerome@mac angular-scan-realworld-angular % ng update @angular/core@22 @angular/cli@22 --force
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 22.0.0 to perform the update.
Using package manager: pnpm
Collecting installed dependencies...
Found 0 dependencies.
Package '@angular/core' is not a dependency.

The repo is open-source: https://github.com/realworld-angular/angular-scan-realworld-angular

Minimal Reproduction

The repo: https://github.com/realworld-angular/angular-scan-realworld-angular

with pnpm

  • run pnpm i
  • run ng update @angular/core@22 @angular/cli@22

with npm

  • remove pnpm lock/workspace files
  • run npm install
  • run ng update @angular/core@22 @angular/cli@22

Exception or Error


Your Environment

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

Angular CLI       : 21.2.14
Angular           : 21.2.16
Node.js           : 24.16.0
Package Manager   : pnpm 11.1.2
Operating System  : darwin arm64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build            │ 21.2.14           │ ^21.2.9           │
│ @angular/cdk              │ 21.2.14           │ ^21.2.10          │
│ @angular/cli              │ 21.2.14           │ ^21.2.9           │
│ @angular/common           │ 21.2.16           │ ^21.2.0           │
│ @angular/compiler         │ 21.2.16           │ ^21.2.0           │
│ @angular/compiler-cli     │ 21.2.16           │ ^21.2.0           │
│ @angular/core             │ 21.2.16           │ ^21.2.0           │
│ @angular/forms            │ 21.2.16           │ ^21.2.0           │
│ @angular/platform-browser │ 21.2.16           │ ^21.2.0           │
│ @angular/router           │ 21.2.16           │ ^21.2.0           │
│ rxjs                      │ 7.8.2             │ ~7.8.0            │
│ typescript                │ 5.9.3             │ ~5.9.2            │
│ vitest                    │ 4.1.8             │ ^4.0.8            │
└───────────────────────────┴───────────────────┴───────────────────┘

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions