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][Regression] ERESOLVE if peerDependencies of dependencies support later major version #3868

Closed
1 task done
kevinoid opened this issue Oct 9, 2021 · 3 comments
Closed
1 task done
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@kevinoid
Copy link

kevinoid commented Oct 9, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

With npm@^7.20.3 or [email protected], when one of the peer dependencies of a dependency includes a later major version than the dependency version (in addition to the same major version), npm install --strict-peer-deps=true fails with ERESOLVE, as described in issue #2055.``

Expected Behavior

npm install should complete successfully with the latest version declared by the dependency (which also satisfies the peer dependency of the other dependency).

Steps To Reproduce

Using the same steps as #2055:

With package.json:

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

Running npm install --strict-peer-deps=true produces:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR!   webpack@"^4.41" from the root project
npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from [email protected]
npm ERR!   node_modules/webpack-dev-server
npm ERR!     webpack-dev-server@"^3.9" from the root project
npm ERR!   1 more (terser-webpack-plugin)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! webpack-dev-middleware@"^3.7.2" from [email protected]
npm ERR! node_modules/webpack-dev-server
npm ERR!   webpack-dev-server@"^3.9" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^4.0.0 || ^5.0.0" from [email protected]
npm ERR!   node_modules/webpack-dev-middleware
npm ERR!     webpack-dev-middleware@"^3.7.2" from [email protected]
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.
npm ERR! 
npm ERR! See /home/user/.cache/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.cache/npm/_logs/2021-10-09T21_37_39_782Z-debug.log

I would expect it to install [email protected], since it is the latest version which satisfies the webpack@^4.41 dependency and it also satisfies the webpack@"^4.0.0 || ^5.0.0" peer dependency from [email protected].

Environment

I believe I've bisected the regression to 97cb5ec which upgraded to @npmcli/[email protected] for #3377.

@kevinoid kevinoid 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 9, 2021
@kevinoid
Copy link
Author

kevinoid commented Oct 9, 2021

Another example:

package.json:

{
  "name": "project-a",
  "dependencies": {
    "eslint": "^7.0.0",
    "eslint-plugin-node": "^11.0.0"
  }
}
npm install --strict-peer-deps=true
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   eslint@"^7.0.0" from the root project
npm ERR!   peer eslint@">=5.16.0" from [email protected]
npm ERR!   node_modules/eslint-plugin-node
npm ERR!     eslint-plugin-node@"^11.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! eslint-plugin-es@"^3.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-node
npm ERR!   eslint-plugin-node@"^11.0.0" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peer eslint@">=4.19.1" from [email protected]
npm ERR!   node_modules/eslint-plugin-es
npm ERR!     eslint-plugin-es@"^3.0.0" from [email protected]
npm ERR!     node_modules/eslint-plugin-node
npm ERR!       eslint-plugin-node@"^11.0.0" 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.
npm ERR! 
npm ERR! See /home/user/.cache/npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.cache/npm/_logs/2021-10-09T21_57_04_502Z-debug.log

@lukekarrys lukekarrys added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels Oct 11, 2021
@lukekarrys
Copy link
Contributor

lukekarrys commented Oct 20, 2021

Thanks for the thorough report @kevinoid! This is the same issue as #3881, but manifesting in that ERESOLVE error when --strict-peer-deps is turned on. The good news is that the fix for that works for this as well. I pulled in npm/arborist#337 and was able to run both your examples successfully now. This fix should go out tomorrow!

{
  "dependencies": {
    "eslint": "^7.0.0",
    "eslint-plugin-node": "^11.0.0"
  }
}
❯ npm i --strict-peer-deps=true
❯ npm ls eslint
[email protected] /Users/lukekarrys/Desktop/npm-sandbox/3868
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
└── [email protected]
{
  "dependencies": {
    "webpack": "^4.41",
    "webpack-dev-server": "^3.9"
  }
}
❯ npm i --strict-peer-deps=true
❯ npm ls webpack
[email protected] /Users/lukekarrys/Desktop/npm-sandbox/3868
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
└─┬ [email protected]
  └─┬ [email protected]
    └── [email protected] deduped

@kevinoid
Copy link
Author

Interesting! Thanks for investigating an implementing a fix @lukekarrys! I'll look forward to it in a future release.

@lukekarrys lukekarrys self-assigned this Oct 20, 2021
kevinoid added a commit to kevinoid/node-project-template that referenced this issue Oct 27, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/node-project-template that referenced this issue Oct 27, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/openapi-transformer-base that referenced this issue Oct 27, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/openapi-transformers that referenced this issue Oct 27, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/eslint-config-kevinoid that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/appveyor-status that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/assert-shim that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/fetch-procore-api-docs that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/git-branch-is that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/hub-ci-status that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/inflate-auto that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/json-replace-exponentials that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/json-stringify-raw that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/mocha-ur2ue that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/nodecat that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/noderegression that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/openapi-transformer-cli that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/openapi-transformer-pipeline that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/procore-docs-to-openapi that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/promised-read that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/promise-nodeify that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/stream-compare that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/swagger-spec-validator that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
kevinoid added a commit to kevinoid/travis-status that referenced this issue Nov 19, 2021
Since it causes npm install to fail with ERESOLVE on npm@^7.20.3 or
npm@>=8.0.0 <8.1.1 due to the combination of eslint@^7.0.0 and
eslint-plugin-node@^11.0.0:
npm/cli#3868 (comment)

Rather than updating npm on the runner during each CI run, remove
--strict-peer-deps until a version of Node.js ships with npm@^8.1.1.

Signed-off-by: Kevin Locke <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

2 participants