Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve dependency tree #178

Open
Firebottle opened this issue Jun 22, 2022 · 3 comments
Open

Unable to resolve dependency tree #178

Firebottle opened this issue Jun 22, 2022 · 3 comments

Comments

@Firebottle
Copy link

Description

While following the instructions to setup a new project via yarn, I've run into an error. "Unable to resolve dependency tree".

Could not resolve dependency:
peer react@"^16.8.3 || ^17" from react-redux@7.2.6
node_modules/react-redux
react-redux@"7.2.6" from app@0.1.0
app
app@0.1.0
node_modules/app
workspace app from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Steps to reproduce

  1. Get yarn setup.
  2. Setup my workspace in package.json.
  3. Follow the "install & start" steps listed on the repo main page.
  4. Halfway through the install process the error will appear and stop the process.

Expected behavior
The install process should finish with no issues.

Screenshots
image

Versions

  • react-boilerplate-cra-template: current
  • Node/NPM: 8.12.2
  • Browser: Vivaldi
@gitname
Copy link

gitname commented Jul 23, 2022

The same error occurs when installing via npm (npm version 8.11.0, node version v16.15.1):

npx create-react-app --template cra-template-rb my-client
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Need to install the following packages:
  create-react-app
Ok to proceed? (y) y
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.

Creating a new React app in C:\Temp\my-client.

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template-rb...

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

added 1450 packages in 1m

204 packages are looking for funding
  run `npm fund` for details

Initialized a git repository.

Installing template dependencies using npm...
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-client@0.1.0
npm ERR! Found: react@18.1.0
npm ERR! node_modules/react
npm ERR!   react@"18.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.3 || ^17" from react-redux@7.2.6
npm ERR! node_modules/react-redux
npm ERR!   react-redux@"7.2.6" 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!

I think the issue is related to the fact that this project's package.json specifies React version 18, but this project also depends on react-redux, which requires React version 16 or 17.

This project changed from using React 17 to React 18 in the following PR, which was merged in late May, shortly before this issue was created: #170

@Can-Sahin
Copy link
Member

#96

does this help?

@gitname
Copy link

gitname commented Aug 2, 2022

Thanks, @Can-Sahin. I did find it informative, in that I learned that using yarn instead of npm would allow the installation to finish instead of fail. I would like to continue using npm since I use it for all my other projects, but that issue at least helps me understand what my options are.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants