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

Could not resolve dependency #1621

Open
kud opened this issue Apr 15, 2021 · 12 comments
Open

Could not resolve dependency #1621

kud opened this issue Apr 15, 2021 · 12 comments

Comments

@kud
Copy link
Contributor

kud commented Apr 15, 2021

m 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@"17.0.1" from @hot-loader/react-dom@17.0.1
npm ERR! node_modules/@hot-loader/react-dom
npm ERR!   dev @hot-loader/react-dom@"17.0.1" from the root project

😬

Do you need more information?

@kud
Copy link
Contributor Author

kud commented Apr 15, 2021

NPM 7 is cool but is less tolerant with dependencies.

I'm not sure to understand. You stuck the version of react to 17.0.1 and I've got the .2, that's right?

@theKashey
Copy link
Collaborator

react-dom have pinned the react peer-dependency and this is what happened.

There are 3 solutions:

  • downgrade React
  • upgrade @hot-loader/react-dom (newer version does not exists right now)
  • postpone npm 7, and if you don't want to be the one to collect all the problems among all the packages - concider it as a best advice.

@kud
Copy link
Contributor Author

kud commented Apr 17, 2021

Thank you @theKashey for the explanation :)

For the moment, I use the command --legacy-peers (something like that) when I install it. It "works".

@theKashey
Copy link
Collaborator

Historically the usage of peer deps was a little wild, including not declaring any peer deps at all.

Eventually we'll get better at this.

@deadcoder0904
Copy link

Thank you, npm i --legacy-peer-deps fixed it!

Isn't there any way to fix this? Because every time I upgrade dependencies, I gotta use --legacy-peer-deps flag. It's so annoying :(

@cssagogo
Copy link

cssagogo commented Oct 8, 2021

What is holding up support for 17.0.2? All the suggested workarounds here so far are not ideal.

@kud
Copy link
Contributor Author

kud commented Oct 8, 2021

I switched to https://github.com/pmmmwh/react-refresh-webpack-plugin

Works so much better.

@machineghost
Copy link

Thanks kud: it seems this project is dead, so it's good to know there's a replacement option!

@theKashey
Copy link
Collaborator

That is the official recommendation for the last couple of years.

@machineghost
Copy link

machineghost commented Jul 29, 2022

That is the official recommendation for the last couple of years.

GitHub really needs a "this project is dead" feature. Many project owners don't even bother to put it on their readme page, and while thankfully this one did, there's no way to even tell from the issues section.

(Not your fault in any way, just a comment about GitHub.)

@kud
Copy link
Contributor Author

kud commented Aug 1, 2022

Usually, I set my projects as "Archived" when a project is dead.

@shawinderjitsingh
Copy link

in my case i just downgraded the version of hot-loader below was the version-
"react":"16.14.0",
"react-hot-loader": "^4.13.0",

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

6 participants