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

[BUG] Could not resolve dependency even though found version should satisfy peer version spec #3440

Closed
1 task done
jemucino opened this issue Jun 19, 2021 · 3 comments
Closed
1 task done
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release

Comments

@jemucino
Copy link

jemucino commented Jun 19, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I try to run npm audit fix, I get the following error:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack@4.44.2
npm ERR! node_modules/webpack
npm ERR!   peer webpack@">=2" from babel-loader@8.1.0
npm ERR!   node_modules/babel-loader
npm ERR!     babel-loader@"8.1.0" from react-scripts@4.0.3
npm ERR!     node_modules/react-scripts
npm ERR!       react-scripts@"^4.0.3" from the root project
npm ERR!   peer webpack@"^4.27.0 || ^5.0.0" from css-loader@4.3.0
npm ERR!   node_modules/css-loader
npm ERR!     css-loader@"4.3.0" from react-scripts@4.0.3
npm ERR!     node_modules/react-scripts
npm ERR!       react-scripts@"^4.0.3" from the root project
npm ERR!   16 more (eslint-webpack-plugin, file-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@">=4.43.0 <6.0.0" from @pmmmwh/react-refresh-webpack-plugin@0.4.3
npm ERR! node_modules/react-scripts/node_modules/@pmmmwh/react-refresh-webpack-plugin
npm ERR!   @pmmmwh/react-refresh-webpack-plugin@"0.4.3" from react-scripts@4.0.3
npm ERR!   node_modules/react-scripts
npm ERR!     react-scripts@"^4.0.3" 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/jemucino/.npm/eresolve-report.txt for a full report.

Expected Behavior

I don't know enough about NPM to say what the expected behavior should be, but shouldn't the found version (4.44.2) satisfy the peer dependency(>=4.43.0 <6.0.0)?

Steps To Reproduce

  1. In my PC (on WSL with Ubuntu 20.04) and using npm@7.16.0
  2. Within a React app created with create-react-app
  3. Run 'npm audit fix'
  4. See error:
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack@4.44.2
npm ERR! node_modules/webpack
npm ERR!   peer webpack@">=2" from babel-loader@8.1.0
npm ERR!   node_modules/babel-loader
npm ERR!     babel-loader@"8.1.0" from react-scripts@4.0.3
npm ERR!     node_modules/react-scripts
npm ERR!       react-scripts@"^4.0.3" from the root project
npm ERR!   peer webpack@"^4.27.0 || ^5.0.0" from css-loader@4.3.0
npm ERR!   node_modules/css-loader
npm ERR!     css-loader@"4.3.0" from react-scripts@4.0.3
npm ERR!     node_modules/react-scripts
npm ERR!       react-scripts@"^4.0.3" from the root project
npm ERR!   16 more (eslint-webpack-plugin, file-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@">=4.43.0 <6.0.0" from @pmmmwh/react-refresh-webpack-plugin@0.4.3
npm ERR! node_modules/react-scripts/node_modules/@pmmmwh/react-refresh-webpack-plugin
npm ERR!   @pmmmwh/react-refresh-webpack-plugin@"0.4.3" from react-scripts@4.0.3
npm ERR!   node_modules/react-scripts
npm ERR!     react-scripts@"^4.0.3" 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/jemucino/.npm/eresolve-report.txt for a full report.

Environment

  • OS: WSL (Ubuntu-20.04)
  • Node: v14.17.0
  • npm: 7.16.0
@jemucino jemucino added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jun 19, 2021
@talsi
Copy link

talsi commented Jun 27, 2021

same as #3171

@wraithgar
Copy link
Member

Closing as a duplicate of #3171

@talsi
Copy link

talsi commented Nov 8, 2021

@wraithgar it still happens to me using 7.24.2

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

3 participants