nilsmehlhorn / ngrx-wieder

Lightweight undo-redo for Angular with NgRx & immer.js
https://nils-mehlhorn.de/posts/angular-undo-redo-ngrx-redux
MIT License
125 stars 10 forks source link

Can't install version 3.1.x with angular 9.1.x and npm 7.x #49

Closed Menecats closed 3 years ago

Menecats commented 3 years ago

Hi, while trying to install the library (version 3.1.1) into an angular 9.1.x application I'm getting this error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: perf-ui@3.10.0-next.6
npm ERR! Found: @angular/common@9.1.13
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"9.1.13" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^8.0.1 - ^9.0.7" from ngrx-wieder@3.1.1
npm ERR! node_modules/ngrx-wieder
npm ERR!   ngrx-wieder@"3.1.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.
npm ERR! 
npm ERR! See /home/menecats/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/menecats/.npm/_logs/2021-08-25T10_47_23_851Z-debug.log

This error only appears in npm 7.x (currently i'm using 7.21.0) as they've changed the peer dependency management strategy. I've installed the library with the --legacy-peer-deps and it works as intended. Can you please update the peer dependency for @angular/common to support also angular 9.1 directly with npm 7?

Thanks

nilsmehlhorn commented 3 years ago

I guess the peer dependency version ^8.0.1 - ^9.0.7 in 3.1.1 was illegal. It should've ben ^8.0.1 || ^9.0.7. https://github.com/nilsmehlhorn/ngrx-wieder/blob/74a78c804ed61b16738e1babf3d52cbd90155fbc/projects/ngrx-wieder/package.json#L25

Are you sure you wouldn't rather update your Angular version and use a newer version of ngrx-wieder?

Menecats commented 3 years ago

That's something that's in my road-map, but unfortunately currently I'm locked with 9.x due to rather big breaking changes in other libraries that I'm using.

nilsmehlhorn commented 3 years ago

And where's the problem with --legacy-peer-deps? Can't you use that, if you're not willing to update?

Menecats commented 3 years ago

That's not a problem, is just an inconvenience, mainly i'd like to avoid updating the automation scripts and teach all the other person in the team that now they have to add the flag during install.

If for you version 3.x is "unmaintained" that's not a problem, i was only asking if it's possible to update the package.json

nilsmehlhorn commented 3 years ago

In that case, it's unmaintaned. You may fork though or keep a local copy of the library.