Installing Transloco in Angular project error

519 Views Asked by At

I am trying to add Transloco in my angular project, I get the following error my Angular project is 12.1.5, do you know how can I fix it.

I tried to first install Transloco it give same kind of error then I tried ng add @ngneat/transloco it give same error

 code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@"^12.0.0 || ^13.0.0-0" from @angular/[email protected]
npm ERR!   node_modules/@angular/cdk
npm ERR!     peer @angular/cdk@"12.2.9" from @angular/[email protected]
npm ERR!     node_modules/@angular/material
npm ERR!       peer @angular/material@">=10.2.7" from [email protected]
npm ERR!       node_modules/mat-table-exporter
npm ERR!         mat-table-exporter@"^10.2.3" from the root project
npm ERR!       1 more (the root project)
npm ERR!     peer @angular/cdk@">=10.2.7" from [email protected]
npm ERR!     node_modules/cdk-table-exporter
npm ERR!       cdk-table-exporter@"^10.2.4" from [email protected]
npm ERR!       node_modules/mat-table-exporter
npm ERR!         mat-table-exporter@"^10.2.3" from the root project
npm ERR!     2 more (mat-table-exporter, the root project)
npm ERR!   peer @angular/common@"12.1.5" from @angular/[email protected]
npm ERR!   node_modules/@angular/forms
npm ERR!     peer @angular/forms@"^12.0.0 || ^13.0.0-0" from @angular/[email protected]
npm ERR!     node_modules/@angular/material
npm ERR!       peer @angular/material@">=10.2.7" from [email protected]
npm ERR!       node_modules/mat-table-exporter
npm ERR!         mat-table-exporter@"^10.2.3" from the root project
npm ERR!       1 more (the root project)
npm ERR!     peer @angular/forms@"^10.0.0 || ^11.0.0 || ^12.0.0" from [email protected]
npm ERR!     node_modules/ngx-quill
npm ERR!       ngx-quill@"^14.3.0" from the root project
npm ERR!     1 more (the root project)
npm ERR!   10 more (@angular/material, @angular/platform-browser, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@">=2.0.0 <7.0.0" from [email protected]
npm ERR! node_modules/angular-crumbs
npm ERR!   angular-crumbs@"^3.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/[email protected]
npm ERR! node_modules/@angular/common
npm ERR!   peer @angular/common@">=2.0.0 <7.0.0" from [email protected]
npm ERR!   node_modules/angular-crumbs
npm ERR!     angular-crumbs@"^3.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
1

There are 1 best solutions below

0
On

First run the following commond to install dependency: npm i --legacy-peer-deps @ngneat/transloco

then run ng add @ngneat/transloco

Read deteals here: https://www.npmjs.com/package/@ngneat/transloco