ACDev
ACDev

Reputation: 149

Angular Material won't install with ng add

When I use the command ng add @angular/material as instructed on the Angular Material setup guide, It doesn't appear to have installed. I try to use the material components in app.module, but I get an error. Furthermore, the package doesn't show to be listed in the package.json file. I'm not sure what could be wrong. I get the following after adding ng add...

$ ng add @angular/material

Additionally, I'm also not prompted to select a theme, typography, etc.

I also have Angular 12 install if that's what's making a difference.

Upvotes: 2

Views: 3863

Answers (2)

rafeen1305
rafeen1305

Reputation: 1

ng add @angular/material@latest

This command worked for me.

Upvotes: 0

Samanthika Rajapaksa
Samanthika Rajapaksa

Reputation: 1050

npm install --save @angular/material @angular/cdk
ng add @angular/material

Try this commmand

Upvotes: 3

Related Questions