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

Can not install with react 18 #27

Open
mohammadxali opened this issue Apr 9, 2022 · 11 comments
Open

Can not install with react 18 #27

mohammadxali opened this issue Apr 9, 2022 · 11 comments

Comments

@mohammadxali
Copy link

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.

@likozGO
Copy link

likozGO commented Apr 19, 2022

the same problem

@AlekseyManetov
Copy link

up

@ghost
Copy link

ghost commented Apr 21, 2022

same

@fragov
Copy link

fragov commented Apr 26, 2022

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

@Vovan-VE
Copy link

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}?

@sgarg15
Copy link

sgarg15 commented Apr 28, 2022

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

@Vovan-VE
Copy link

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./

@sgarg15
Copy link

sgarg15 commented Apr 28, 2022

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

@Vovan-VE
Copy link

@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.

@RobPethick
Copy link
Owner

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

@gihanrangana
Copy link

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

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

8 participants