jtc10005 / ngx-flex-layout

port of @angular/flex-layout to support @angular > v15
MIT License
17 stars 1 forks source link

npm "Could not resolve dependency" with Angular 18 #8

Closed Mr-Vinti closed 5 months ago

Mr-Vinti commented 6 months ago

Bug Report

What is the expected behavior?

To install ngx-flex-layout via npm without issues This is a copy of https://github.com/jtc10005/ngx-flex-layout/issues/5 , as Angular just launched v18

What is the current behavior?


npm ci
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: ngx-flexible-layout@17.0.4
npm ERR! Found: @angular/cdk@18.0.0
npm ERR! node_modules/@angular/cdk
npm ERR!   @angular/cdk@"^18.0.0" from the root project
npm ERR!   peer @angular/cdk@"18.0.0" from @angular/material@18.0.0
npm ERR!   node_modules/@angular/material
npm ERR!     @angular/material@"^18.0.0" from the root project
npm ERR!     peer @angular/material@"18.0.0" from @angular/material-luxon-adapter@18.0.0
npm ERR!     node_modules/@angular/material-luxon-adapter
npm ERR!       @angular/material-luxon-adapter@"^18.0.0" from the root project
npm ERR!   1 more (ngx-scrollbar)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/cdk@"^17.0.0" from ngx-flexible-layout@17.0.4
npm ERR! node_modules/ngx-flexible-layout
npm ERR!   ngx-flexible-layout@"^17.0.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/cdk@17.3.10
npm ERR! node_modules/@angular/cdk
npm ERR!   peer @angular/cdk@"^17.0.0" from ngx-flexible-layout@17.0.4
npm ERR!   node_modules/ngx-flexible-layout
npm ERR!     ngx-flexible-layout@"^17.0.4" 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.```

#### What are the steps to reproduce?
Try to install the module on a project with v18 or try to upgrade a v17 project to v18

#### What is the use-case or motivation for changing an existing behavior?
N/A

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 18

#### Is there anything else we should know?
N/A
jtc10005 commented 6 months ago

working on this now

jtc10005 commented 6 months ago

should be resolved in #9. V18.0.0 published

Mr-Vinti commented 6 months ago

I think you might've missed bumping a dependency:

npm ERR! Found: @angular/common@18.0.0
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^18.0.0" from the root project
npm ERR!   peer @angular/common@"^18.0.0 || ^19.0.0" from @angular/cdk@18.0.0
npm ERR!   node_modules/@angular/cdk
npm ERR!     @angular/cdk@"^18.0.0" from the root project
npm ERR!     peer @angular/cdk@"^18.0.0" from ngx-flexible-layout@18.0.0
npm ERR!     node_modules/ngx-flexible-layout
npm ERR!       ngx-flexible-layout@"18" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^17.0.4" from ngx-flexible-layout@18.0.0
npm ERR! node_modules/ngx-flexible-layout
npm ERR!   ngx-flexible-layout@"18" from the root project

Would this line also require changes? I notice in the last PR that it was also updated: https://github.com/jtc10005/ngx-flex-layout/blob/438733dab1185c624179c568b3ec15108654c262/package.json#L32C1-L33C1

jtc10005 commented 5 months ago

reopening till issue resolved

jtc10005 commented 5 months ago

@Mr-Vinti Good catch. I did miss that. Will you see if it works now? I will leave this open till you say its good.

Mr-Vinti commented 5 months ago

That worked perfectly, thank you!