3

I tried to Install Angular Material using ng add @angular/material but I get those errors I am up to date with my angular cli The error

1 Answer 1

3

You need to install the right version of angular material for your version of angular. You are trying to install Angular material v13, so you probably have some Angular version lower than 13.

For example if your Angular is v12:

npm install @angular/[email protected]

Or update your angular application to 13 following the Official Update Guide and then install angular material.

If you read the error, it is telling you that it can't find certain packages, for example @angular/core@13. So if you check your package.json, you will find that your @angular/core does not match what the installation is looking for.

Another option is to force the installation, and then update your angular application. Whichever way you go, the versions need to match.

Sign up to request clarification or add additional context in comments.

8 Comments

Angular CLI: 13.2.6 -Node: 16.15.0 So I checked my angular version using ng --version and it said I am angular 13
Those are your global versions, what about those in the project? Check the package.json in the project.
even in package.json it's 13.2.0
Ah yh, sorry, the error says it could not resolve dependency [email protected]. You need to install those dependencies. The error is pretty descriptive. It is saying you have 13.2, but need 13.3.11 or higher... The same for animations. You should be good just by updating your angular.
Did this solve your problem? If so, consider marking it as the right answer. Cheers.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.