Reputation:
When i tried to compile the app, it threw this error:
ERROR in src/app/app.module.ts(15,5): error TS2304: Cannot find name 'MatToolbarModule'. src/app/app.module.ts(16,5): error TS2304: Cannot find name 'MatSidenavModule'. src/app/app.module.ts(17,5): error TS2304: Cannot find name 'MatButtonModule'. src/app/app.module.ts(18,5): error TS2304: Cannot find name 'MatIconModule'. src/app/app.module.ts(19,5): error TS2304: Cannot find name 'MatListModule'. src/app/app.module.ts(20,5): error TS2304: Cannot find name 'MatMenuModule'. src/app/app.module.ts(21,5): error TS2304: Cannot find name 'AuthModule'. src/app/app.module.ts(22,5): error TS2304: Cannot find name 'AppRoutingModule'. src/app/app.module.ts(24,5): error TS2304: Cannot find name 'MatGridListModule'. src/app/app.module.ts(25,5): error TS2304: Cannot find name 'FlexLayoutModule'.
When I try to add material to project by ng add @angular/material
it shows me this:
Package "@angular/material" was found but does not support schematics.
Does anyone find a solution for this?
Upvotes: 1
Views: 15161
Reputation: 1788
After upgrading to angular cli,
run the following command to uninstall @angular/material
npm uninstall @angular/material
After this run the command
ng add @angular/material
This will solve the issue.
Upvotes: 2
Reputation:
After installing material again, I got a new error, but I found the answer here: Angular 2 agm error. It was a compatibility problem with map wrapper.
Upvotes: 0
Reputation: 145
I could easily add Material 6.0 to both of my projects (recently updated to Angular 6). I had to update Angular CLI as well (locally and globally) though. After you added the Material package with ng add @angular/material
, try npm install
once again. It should be okay.
Upvotes: 3
Reputation: 1847
Package "@angular/material" was found but does not support schematics.
This basically means Angular Material does not support ng add, you'd have to wait for the newer version where schematics are implemented.
If you have an old version of it, then you can use ng update @angular/material using the latest CLI. Else, just follow the official instructions:
npm install --save @angular/material @angular/cdk
Upvotes: 0