Ionic5 with angular/material

this is my environment

+-- @angular/cli@12.1.4
+-- @ionic/cli@6.17.1
+-- node@16.9.1
`-- npm@7.23.0

i’ve tried

ionic start ionic-material-app blank --type=angular
cd ionic-material-app
ng add @angular/material
The package @angular/material@12.2.6 will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ionic-material-app@0.0.1
npm ERR! Found: @angular/core@12.1.5
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"~12.1.1" from the root project
npm ERR!   peer @angular/core@"^12.0.0 || ^13.0.0-0" from @angular/material@12.2.6
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"12.2.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"12.2.6" from @angular/animations@12.2.6
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"^12.0.0 || ^13.0.0-0" from @angular/material@12.2.6
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"12.2.6" from the root project

tried with:

ng add @angular/material@12.1.4
The package @angular/material@12.1.4 will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ionic-material-app@0.0.1
npm ERR! Found: @angular/core@12.1.5
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"~12.1.1" from the root project
npm ERR!   peer @angular/core@"^12.0.0 || ^13.0.0-0" from @angular/material@12.1.4
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"12.1.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"12.2.6" from @angular/animations@12.2.6
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"^12.0.0 || ^13.0.0-0" from @angular/material@12.1.4
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"12.1.4" from the root project

any tip?

I’ve added “@angular/animations”: “~12.1.1” on “dependencies” and excecuted:
ng add @angular/material
worked

1 Like