How to resolve dependency issue - Angular14 flex-layout

Viewed 1156

I am using Angular14 and tried to install Angular Flex layout.

I am getting this error: after running the command - ng add @angular/flex-layout

error Found: @angular/cdk@14.0.2
error node_modules/@angular/cdk
error   @angular/cdk@"^14.0.2" from the root project
error
error Could not resolve dependency:
error peer @angular/cdk@"^13.0.0" from @angular/flex-layout@13.0.0-beta.38
error node_modules/@angular/flex-layout
error   @angular/flex-layout@"13.0.0-beta.38" from the root project

So, to use it, do I need to downgrade angular? or there is a workaround to this?

3 Answers

You could also use --legacy-peer-deps

npm install --save --legacy-peer-deps @angular/flex-layout

Yes, using --legacy-peer-deps or --force will work but not in all cases. If you need to do a "ng add" command then these will not work and will cause the error to be thrown. So an update must be provided ASAP

Related