An unhandled exception occurred: Collection "@angular/material" cannot be resolved

Viewed 568

I am trying to run this schematic for my angular project:

ng generate @angular/material:material-table --name data-table 

However, running it in the terminal for vs code gives an error

An unhandled exception occurred: Collection "@angular/material" cannot be resolved.

Could someone please tell me how I would get rid of this error so that I can generate my required schematic in my angular project?

1 Answers

It looks like your Angular Material is broken, try reinstalling using the command

ng add @angular/material
Related