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] Seemingly erroneous peer dependency conflict (ERESOLVE) #2055

Closed
markmckenna opened this issue Oct 27, 2020 · 3 comments
Closed

[BUG] Seemingly erroneous peer dependency conflict (ERESOLVE) #2055

markmckenna opened this issue Oct 27, 2020 · 3 comments
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

@markmckenna
Copy link

Using npm@7.0.3

package.json:

{
  "name": "project-a",
  "dependencies": {
    "webpack": "^4.41",
    "webpack-dev-server": "^3.9"
  }
}

Actual

$ npm install --strict-peer-deps=true
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: webpack-dev-server@3.11.0
npm ERR! Found: webpack@5.3.0
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from webpack-dev-server@3.11.0
npm ERR!   node_modules/webpack-dev-server
npm ERR!     webpack-dev-server@"^3.9" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0" from webpack-dev-middleware@3.7.2
npm ERR! node_modules/webpack-dev-middleware
npm ERR!   webpack-dev-middleware@"^3.7.2" from webpack-dev-server@3.11.0
npm ERR!   node_modules/webpack-dev-server
npm ERR!     webpack-dev-server@"^3.9" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --no-strict-peer-deps, --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

NOTE: Without --strict-peer-deps this resolves fine, without any (related) warning.

Expected

It seems like these peer dependencies should resolve just fine:

  • I full-depend on webpack major 4 and webpack-dev-server
  • webpack-dev-server peer-depends on webpack major 4 or 5 and webpack-dev-middleware
  • webpack-dev-middleware peer-depends on webpack major 4

It seems like it's maxing out webpack-dev-server's acceptable range first, then resolving that against other packages in the repo, even though there's a non-peer dependency that should be pinning it to v4, which is also acceptable to webpack-dev-server.

@markmckenna markmckenna 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 Oct 27, 2020
@isaacs
Copy link
Contributor

isaacs commented Oct 28, 2020

Fixed in latest release.

@isaacs isaacs closed this as completed Oct 28, 2020
@markmckenna
Copy link
Author

Apologies! I tried to update to latest yesterday and stayed at 7.0.3. I'll bring myself up.

@saabdal
Copy link

saabdal commented Feb 19, 2021

Hey All, what do you that this is fixed in the latest release....?

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