I'm new into Angular development and learning how to use Redux. While trying to install Redux using
npm install redux @angular-redux/store --save
, the terminal throws up the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: myapp@0.0.0
npm ERR! Found: @angular/core@14.2.12
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"^14.2.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"^7.0.0" from @angular-redux/store@10.0.0
npm ERR! node_modules/@angular-redux/store
npm ERR! @angular-redux/store@"*" 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 C:\Users\Admin\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Admin\AppData\Local\npm-cache\_logs\2023-02-08T07_15_27_253Z-debug-0.log
What I have tried:
I tried installing
redux and
@angular-redux/store separately. That way, while
redux is getting installed successfully,
@angular-redux/store still throws up the same error. I tried checking for solutions, but in most forums,
npm install redux @angular-redux/store --save
is the recommended command to install them. Even
npm and the official sites say so.
Even after force install, I can't use
import { NgReduxModule, NgRedux } from '@angular-redux/store';
in
app.module.ts, neither can I access
NgReduxModule
and
NgRedux
in the
imports
array of
app.module.ts.
So what's wrong with my system? How do I get rid of the errors and can install Redux successfully? Please help as I'm new into it and finding it difficult to figure it out.
My development environment trivia:
1) Node: 18.12.1
2) Package Manager: npm 8.5.5
3) Angular CLI: 14.2.10
4) Angular: 14.2.12
5) OS: Windows 10 win32 x64
Regards.