0

To familiarize myself with Redux for a side job, I tried creating a project with the create-react-app redux template, and ran into this error:

Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.3 || ^17" from [email protected]
npm ERR! node_modules/react-redux
npm ERR!   react-redux@"^7.2.3" 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 /Users/itsme/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/itsme/.npm/_logs/2022-03-30T07_04_21_133Z-debug-0.log
`npm install --no-audit --save @reduxjs/toolkit@^1.5.1 @testing-library/jest-dom@^4.2.4 @testing-library/react@^9.3.2 @testing-library/user-event@^7.1.2 react-redux@^7.2.3` failed

I thought the issue might be emanating from the template, so I created a vanilla create-react-app project, and then tried installing react-redux manually, but got the same error. Running the --force and --legacy-peer-deps commands don't have any effect. My Node (v16.14.2) and npm (8.5.5) versions are up-to-date. Can anyone tell me what's going on here?

2
  • can you tell me what the exact command you used for redux template Commented Mar 30, 2022 at 7:32
  • @DharmikPatel command used was npx create-react-app my-app --template redux Commented Mar 30, 2022 at 7:34

1 Answer 1

0

First write

npm config set legacy-peer-deps true 

and then install your package.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.