Skip to content

bug(COMPONENT): ng update command throws error for Angular material packages #26929

Closed
@naveedahmed1

Description

@naveedahmed1

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

ng update command throws error for Angular material packages:

Command
ng update @angular/cdk @angular/material @angular/google-maps --create-commits=true --force=true --next

Error

An unhandled exception occurred: Cannot find module '\node_modules\@angular\material\schematics\ng-update\index'
Require stack:
- \node_modules\@angular\cli\src\command-builder\utilities\schematic-engine-host.js
See "\AppData\Local\Temp\ng-At5sID\angular-errors.log" for further details.

Reproduction

Steps to reproduce:

  1. Use the below json file
{
  "name": "mustakbil",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "16.0.0-rc.0",
    "@angular/cdk": "16.0.0-next.4",
    "@angular/common": "16.0.0-rc.0",
    "@angular/compiler": "16.0.0-rc.0",
    "@angular/core": "16.0.0-rc.0",
    "@angular/fire": "7.5.0",
    "@angular/forms": "16.0.0-rc.0",
    "@angular/google-maps": "16.0.0-next.4",
    "@angular/material": "16.0.0-next.4",
    "@angular/platform-browser": "16.0.0-rc.0",
    "@angular/platform-browser-dynamic": "16.0.0-rc.0",
    "@angular/platform-server": "16.0.0-rc.0",
    "@angular/pwa": "16.0.0-rc.0",
    "@angular/router": "16.0.0-rc.0",
    "@angular/service-worker": "16.0.0-rc.0",
    "aspnet-prerendering": "3.0.1",
    "rxjs": "~7.8.0",,
    "tslib": "^2.3.0",
    "zone.js": "~0.13.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^16.0.0-rc.0",
    "@angular/cli": "~16.0.0-rc.0",
    "@angular/compiler-cli": "^16.0.0-rc.0",
    "@types/fingerprintjs2": "2.0.0",
    "@types/jasmine": "~4.3.0",
    "@types/webappsec-credential-management": "0.6.3",
    "concat": "3.0.0",
    "html-minifier-terser": "^5.1.1",
    "jasmine-core": "~4.6.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "typescript": "~5.0.2"
  }
}

  1. Run command ng update @angular/cdk @angular/material @angular/google-maps --create-commits=true --force=true --next

Expected Behavior

The ng update command should work fine without throwing error.

Actual Behavior

Throws below error:

ng update command throws error for Angular material packages:

Error

An unhandled exception occurred: Cannot find module '\node_modules\@angular\material\schematics\ng-update\index'
Require stack:
- \node_modules\@angular\cli\src\command-builder\utilities\schematic-engine-host.js
See "\AppData\Local\Temp\ng-At5sID\angular-errors.log" for further details.

Environment

  • Angular:16.0.0-rc.0
  • CDK/Material: 16.0.0-rc.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundarea: material/core

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions