dutiyesh / dutiyesh/react-expand-collapse

ERESOLVE unable to resolve dependency tree with npm@7 and react@17

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
13
Forks
5
PR merge metrics
No merged PRs in 30d

Description

A clean install with npm@7+ and react@17+ throws the following error message and can currently only be fixed with `npm install --force` as workaround.

```sh
$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-project@1.0.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.3.0 || ^16.0.0" from react-expand-collapse@0.2.0
npm ERR! node_modules/react-expand-collapse
npm ERR! react-expand-collapse@"^0.2.0" 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//.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! /home//.npm/_logs/2021-07-12T05_32_56_555Z-debug.log
```

Update peerDependencies in your `package.json` should do the trick:
https://github.com/dutiyesh/react-expand-collapse/blob/0dee3ea90b7d56a70237aced01b836d671d31f0a/package.json#L30-L33

```diff
- "react": "^15.3.0 || ^16.0.0",
+ "react": "^15.3.0 || ^16.0.0 || ^17.0.0",
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.