Skip to content

peerDependencies validation should compatiable with pnpm.overrides #8978

@Timeless0911

Description

@Timeless0911

Verify latest release

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

pnpm version

10.0.0

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

Dependencies resolver

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

No response

Reproduction steps

Any repo with peerDependencies specification and pnpm.overrides with link: or file: protocol to override peerDependencies.

Describe the Bug

Hi, it is really a breaking change to directly prohibit peer dependencies from using link: and file: protocols which introduced in #8942.

There exists a scene that when we need to debug packages from two different repos, we usually write pnpm.overrides or running pnpm link to do symlinks.

"pnpm": {
  "overrides": {
    "@foo/bar": "link:../baz",
  }
}

This feature of validation in peerDependencies prevents us to using pnpm.overrides like above.

May I ask how can I skip error of ERR_PNPM_INVALID_PEER_DEPENDENCY_SPECIFICATION  after bumping [email protected] with changes of this PR?

Expected Behavior

It would be better to provide a configuration in .npmrc like verify-deps-before-run to make it configurable to disable this validation behaviour.

Which Node.js version are you using?

22.10.0

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)

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions