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

Using strict-peer-dependencies along with pnpm.overrides doesn't working as expected #7572

Open
2 of 4 tasks
philbates35 opened this issue Jan 26, 2024 · 1 comment
Open
2 of 4 tasks

Comments

@philbates35
Copy link

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

No response

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

package.json:

{
  "devDependencies": {
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.29.1"
  },
  "pnpm": {
    "overrides": {
      "eslint-plugin-import": "npm:eslint-plugin-i"
    }
  }
}

.npmrc:

strict-peer-dependencies=true

Then install:

pnpm install

Packages: +128
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 128, reused 128, downloaded 0, added 128, done

dependencies:
+ eslint-plugin-import <- eslint-plugin-i 2.29.1

devDependencies:
+ eslint-import-resolver-typescript 3.6.1

 ERR_PNPM_PEER_DEP_ISSUES  Unmet peer dependencies

.
└─┬ eslint-import-resolver-typescript 3.6.1
  └── ✕ unmet peer eslint-plugin-import@npm:eslint-plugin-i: found 2.29.1

hint: If you don't want pnpm to fail on peer dependency issues, add "strict-peer-dependencies=false" to an .npmrc file at the root of your project.

However if I don't use pnpm.overrides and inline the override it works fine:

{
  "devDependencies": {
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1"
  }
}
pnpm install

Packages: +128
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 128, reused 128, downloaded 0, added 128, done

dependencies:
+ eslint-plugin-import <- eslint-plugin-i 2.29.1

devDependencies:
+ eslint-import-resolver-typescript 3.6.1

Done in 6s

Describe the Bug

When using strict-peer-deps=true with pnpm.overrides peer deps fails even though when i inline the override it works fine.

I expected that these two ways of doing overrides would be equivalents, though feel free to correct me if I'm wrong and I'll close the ticket 😄

Expected Behavior

I should be able to successfully install when using pnpm.overrides in the same way as inlining the override.

Which Node.js version are you using?

20.11

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Fedora 38

@Aghassi
Copy link

Aghassi commented Apr 4, 2024

I believe this also applies for .pnpmfile.cjs. @zkochan can you confirm this is the case? I find when running an install that I'll fail the strict peer check if I add a new dependency, but the follow up install is fine and my lockfile is generated fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants