Skip to content

dedupe-peer-dependents sometimes doesn't #6171

Description

@anomiex

pnpm version: 7.29.0-1

Code to reproduce the issue:

.npmrc:

dedupe-peer-dependents=true

pnpm-workspace.yaml:

packages:
  - 'a'
  - 'b'

a/package.json:

{
  "dependencies": {
    "terser-webpack-plugin": "5.2.4",
    "webpack": "5.61.0",
    "webpack-cli": "4.9.1"
  }
}

b/package.json:

{
  "dependencies": {
    "terser-webpack-plugin": "5.2.4",
    "webpack": "5.61.0"
  }
}

Steps to reproduce:

  1. Run pnpm install.
  2. In b, run pnpm update.

Expected behavior:

Lock file has only /webpack/5.61.0_webpack-cli@4.9.1.

Actual behavior:

Lock file has both /webpack/5.61.0_webpack-cli@4.9.1 and /webpack/5.61.0.

Additional information:

  • node -v prints: v18.13.0
  • Windows, macOS, or Linux?: Linux

Notes:

It gives the expected behavior if you run pnpm update in a instead of b. That's a different bug (#3935).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions