react-custom-scrollbars-2 icon indicating copy to clipboard operation
react-custom-scrollbars-2 copied to clipboard

Can not install with react 18

Open mohammadxali opened this issue 2 years ago • 11 comments

Hi, trying to install this package using npm but it seems like it has conflicts with react 18, here are the logs:

$ npm install react-custom-scrollbars-2 --save
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@"^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" from [email protected]  
npm ERR! node_modules/react-custom-scrollbars-2
npm ERR!   react-custom-scrollbars-2@"*" 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.

Should probably add react ^18.0.0 to the list of peer dependencies as well.

mohammadxali avatar Apr 09 '22 07:04 mohammadxali

the same problem

likozGO avatar Apr 19 '22 18:04 likozGO

up

AlekseyManetov avatar Apr 20 '22 08:04 AlekseyManetov

same

ghost avatar Apr 21 '22 04:04 ghost

Works great with react 18, may you update peerDeps, please?

fragov avatar Apr 26 '22 11:04 fragov

This repo is due to the original (fantastic) react-custom-scrollbars package going a little stale and we needed a handful of bug fixes which will be managed here.

Is this repo repeating the history? Will somebody else fork new react-custom-scrollbars-{N+1} for every new major React ^{X+1} release because previous react-custom-scrollbars-{N} stale on React ^{X}?

Vovan-VE avatar Apr 28 '22 01:04 Vovan-VE

If someone finds a solution to this problem please let us know, I am also having the same issue.

sgarg15 avatar Apr 28 '22 01:04 sgarg15

Well, if it

Works great with react 18

then you can just npm i --legacy-peer-deps react-custom-scrollbars-2, but it inconvenient in some cases. /C.O./

Vovan-VE avatar Apr 28 '22 01:04 Vovan-VE

Sorry I am a bit new, could you explain what the "--legacy-peer-deps" tag does and how can it be inconvenient? Thanks!

sgarg15 avatar Apr 28 '22 01:04 sgarg15

@sgarg15 , Modern npm installs packages from peerDependencies for you (and this cause extra checks). In old versions it didn't (just displaying advices for you), so you care yourself to install appropriate packages with respect to advices raised from peerDependencies. So, when you having React 18 installed do npm i --legacy-peer-deps react-custom-scrollbars-2, you say to npm to skip modern handling for peerDependencies.

The problem with that may raise later, for example, when you delete node_modules/ and run npm i without arguments instead of npm ci. I don't know exactly full background and results of --legacy-peer-deps.

Vovan-VE avatar Apr 28 '22 02:04 Vovan-VE

Apologies for the delay - v4.5.0 now released with React 18 support! Thank you @AlekseyManetov 🚀

RobPethick avatar Jun 13 '22 20:06 RobPethick

Apologies for the delay - v4.5.0 now released with React 18 support! Thank you @AlekseyManetov 🚀

still doesn't work with react 18.2.0 image

gihanrangana avatar Jun 27 '23 04:06 gihanrangana