react-beautiful-dnd icon indicating copy to clipboard operation
react-beautiful-dnd copied to clipboard

Cannot install for react 18

Open Olivernha opened this issue 2 years ago • 15 comments

In react 18 installed with vite , when installing react-beautiful-dnd, npm err happens.Anyone fix about it?

Olivernha avatar Jul 07 '22 16:07 Olivernha

@types/react-beautiful-dnd cannot be installed for react 18.

webapp$ npm i --save-dev @types/react-beautiful-dnd
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.2.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.8.5 || ^17.0.0" from [email protected]
npm ERR! node_modules/react-beautiful-dnd
npm ERR!   react-beautiful-dnd@"^13.1.0" from the root project
npm ERR! 

hexwit avatar Jul 08 '22 10:07 hexwit

Update: deleting node_modules and installing deps again solved the problem.

hexwit avatar Jul 08 '22 11:07 hexwit

Update: deleting node_modules and installing deps again solved the problem.

I tried delete node_modules and reinstall deps again, it does not solve the problem for me, until I downgrade React version to 17 again

Update : moving the content of the peer-dependency of [email protected] in package-lock.json solved the problem. moving react From "peerDependencies":{ "react":"^16.8.5 || ^17.0.0" } to -> "Dependencies":{ "react":"18.0.2" }

AmineDeflaoui avatar Jul 12 '22 00:07 AmineDeflaoui

is there another way to use this in react 18?

Jova266 avatar Jul 12 '22 10:07 Jova266

Fix this for gods sake. There are no breaking changes just update react in your project.

Code-Divine avatar Jul 12 '22 11:07 Code-Divine

rade React version to 17 again

Try install with --force command

npm install react-beautiful-dnd --save --force

anti-duhring avatar Jul 12 '22 22:07 anti-duhring

Same problem

kamami avatar Jul 13 '22 12:07 kamami

Same problem

Just update your react-beautiful-dnd dependencies it will solve the problem

AmineDeflaoui avatar Jul 13 '22 13:07 AmineDeflaoui

rade React version to 17 again

Try install with --force command

npm install react-beautiful-dnd --save --force

Will --force cause some other problems?

Jova266 avatar Jul 13 '22 15:07 Jova266

Same problem

Just update your react-beautiful-dnd dependencies it will solve the problem

In order to have dependencies I need to install it first on react 17, then move to react 18? and after that change the dnd dependencies?

Jova266 avatar Jul 13 '22 15:07 Jova266

Yes that's what I did, I re-installed react 17.0.2 again , npm install => no problems , then I updated React to 18 npm install = > show the error , then I change the dependencies of react-beautiful-dnd to correspond to React 18 , npm install => no errors . And For your first question : if you do "npm install react-beautiful-dnd --save --force" or "--legacy-peer-deps" it will move react to peerDependencies and ignore all peerDependencies when installing, and each time yo udo npm install you always need to add --force or --legacy-peer-deps

AmineDeflaoui avatar Jul 13 '22 15:07 AmineDeflaoui

Pleaseee can this be updated

JClackett avatar Aug 10 '22 15:08 JClackett

🎉 @hello-pangea/dnd now supports React 18 and react strict mode!

  1. npm install @hello-pangea/dnd
  2. Replace all imports of react-beautiful-dnd with @hello-pangea/dnd
  3. Enjoy :)

Xhale1 avatar Aug 12 '22 21:08 Xhale1

Hello! I released a fork of this project which supports React 18.

Run npm install @hello-pangea/dnd and replace all imports of react-beautiful-dnd with @hello-pangea/dnd (I just did a find all and replace)

A few changes had to be made to the library to get it to work with React 18's development mode changes. Hoping to continue development there :)

https://github.com/hello-pangea/dnd

Nice! There's any discord/forum to support this lib? I would love to help

anti-duhring avatar Aug 12 '22 21:08 anti-duhring

Nice! There's any discord/forum to support this lib? I would love to help

Sure sure! Glad you're interested in helping out!

https://discord.gg/3JqZpTFD (note: I just made this so it's pretty empty)

We should probably move things over to the hello-pangea/dnd repo so we don't spam notify people here / get too off topic.

Xhale1 avatar Aug 13 '22 07:08 Xhale1

Accepted react versions have been updated. Thanks for the patience on this folks

danieldelcore avatar Aug 30 '22 03:08 danieldelcore

is there any update?

bassamIHabash avatar Jun 26 '23 21:06 bassamIHabash