Skip to content

bug(*): Issue with ng add @angular/material in Angular CLI #28985

Closed
@samir-dahal

Description

@samir-dahal

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

17.3.5

Description

Dear Angular Team,

I encountered an issue while using the Angular CLI to integrate @angular/material into a new project. Here are the steps I followed and the problem I observed:

  1. Environment:

    • Angular project created using the Angular CLI.
    • Angular CLI version: [18.2.12].
    • Node.js version: [22.11.0].
  2. Issue:

    • I ran the command ng add @angular/material in the terminal.
    • The installation was marked as successful, but the necessary project files (e.g., angular.json, app.config.ts, styles.css, etc) were not modified.
    • Additionally, the following error was displayed:
      Cannot find module '\node_modules\@angular\cli\node_modules\@schematics\angular\private\components.js'
      

I also checked the node_modules folder but didn't find any folder named "private"

Reproduction

StackBlitz link: Sorry, I am working on my local machine, so cannot provide the link here.
Steps to reproduce:

  1. Create a new project using angular CLI
  2. Add the @angular/material using ng add @angular/material

Expected Behavior

Should properly install the @angular/material package.

Actual Behavior

Error after installing the package.

     Cannot find module '\node_modules\@angular\cli\node_modules\@schematics\angular\private\components.js'

Environment

  • Angular: 18.2.12
  • CDK/Material: 19.0.0
  • Browser(s): Microsoft Edge 131.0.2903.63 (Official build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu):

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions