Skip to content

ng update wants to update @angular/material in project that does not have it installed #29627

Closed

Description

@rubiesonthesky

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

19.1.6

Description

Running ng update offers update to @angular/material even though it is not installed to the project. The project has @angular/cdk and @angular/cdk-experimental installed.

    We analyzed your package.json, there are some packages to update:

      Name                                Version                  Command to update
     ---------------------------------------------------------------------------------
      @angular/cli                        19.1.6 -> 19.1.7         ng update @angular/cli
      @angular/core                       19.1.5 -> 19.1.6         ng update @angular/core
      @angular/material                   19.1.3 -> 19.1.4         ng update @angular/material

I think it should have @angular/cdk instead of material here.

For some reason, @angular/cdk-experimental is never listed in this list, even though you always need to update it same time as @angular/cdk.

Minimal Reproduction

ng update

Exception or Error


Your Environment

Angular CLI: 19.1.6
Node: 22.11.0
Package Manager: npm 11.0.0
OS: darwin arm64

Angular: 19.1.5
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.6
@angular-devkit/build-angular   19.1.6
@angular-devkit/core            19.1.6
@angular-devkit/schematics      19.1.6
@angular/cdk                    19.1.3
@angular/cdk-experimental       19.1.3
@angular/cli                    19.1.6
@schematics/angular             19.1.6
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else relevant?

I'm not sure if this should have been reported here or in the components repository.

Activity

  1. changed the title [-]ng update wants to update @angular/material in project that does not have installed[/-] [+]ng update wants to update @angular/material in project that does not have it installed[/+] on Feb 12, 2025
  2. added 2 commits that reference this issue on Feb 13, 2025
    45ddf7c
    943ec65
  3. alan-agius4 commented on Feb 13, 2025

    @alan-agius4
    Collaborator

    There are two issues here:

    1. The logs display @angular/material instead of @angular/cdk, likely due to the fallback behavior of the group names. I have a PR to address this here: fix(@angular/cli): prefer installed package as fallback when listing package groups #29629

    2. The package @angular/cdk-experimental is missing from the list. Technically, it should not be listed, similar to how packages like @angular/core and @angular/forms are not explicitly shown. This is because the update command targets a group of packages. However, in this case, @angular/cdk-experimental is not included in any group, which will cause the update to fail. PR here: build: add missing packageGroup fields and packages in package.json components#30486

  4. self-assigned this
    on Feb 13, 2025
  5. added
    freq1: low
    on Feb 13, 2025
  6. added a commit that references this issue on Feb 13, 2025
    ceba773
  7. added a commit that references this issue on Feb 13, 2025
    09f5006
  8. angular-automatic-lock-bot commented on Mar 16, 2025

    @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.

  9. locked and limited conversation to collaborators on Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular/clifreq1: lowng update DXseverity5: regressiontype: bug/fix

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions