Open itsjesski opened 2 years ago
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: https://github.com/react-boilerplate/react-boilerplate-cra-template/pull/170
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.
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
Expected behavior The install process should finish with no issues.
Screenshots
Versions