Skip to content

[BUG] Different packages ([email protected] and foo@npm:[email protected]) are deduped #7884

Closed

Description

@regseb

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

[email protected] /home/regseb/testcase
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
  └── [email protected] deduped

Expected Behavior

[email protected] /home/regseb/testcase
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
  └── playwright-core@npm:[email protected]

Steps To Reproduce

  1. With this package.json
    {
      "name": "testcase",
      "version": "1.0.0",
      "type": "module",
      "dependencies": {
        "playwright": "1.48.2",
        "rebrowser-playwright": "1.48.2"
      }
    }
  2. Run:
    • npm install
    • npm list --all
  3. See that the playwright-core package is deduplicated, whereas it's different in the packages:
    • playwright uses "1.48.2"
      // node_modules/playwright/package.json
      {
        "name": "playwright",
        "version": "1.48.2",
        /* ... */
        "dependencies": {
          "playwright-core": "1.48.2"
        },
        /* ... */
      }
    • rebrowser-playwright uses "npm:rebrowser-playwright-core@~1.48.2"
      // node_modules/rebrowser-playwright/package.json
      {
        "name": "rebrowser-playwright",
        "version": "1.48.2",
        /* ... */
        "dependencies": {
          "playwright-core": "npm:rebrowser-playwright-core@~1.48.2"
        },
        /* ... */
      }

With different versions, packages are not deduplicated:

{
  "name": "testcase",
  "version": "1.0.0",
  "type": "module",
  "dependencies": {
    "playwright": "1.48.1",
    "rebrowser-playwright": "1.48.2"
  }
}
[email protected] /home/regseb/testcase
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
  └── playwright-core@npm:[email protected]

Environment

  • npm: 10.9.0
  • Node.js: v22.10.0
  • OS Name: Ubuntu 24.04.1 LTS
  • System Model Name: Dell Inc. Inspiron 5379
  • npm config:
; "user" config from /home/regseb/.npmrc

//registry.npmjs.org/:_authToken = (protected)

; node bin location = /home/regseb/.nvm/versions/node/v22.10.0/bin/node
; node version = v22.10.0
; npm local prefix = /home/regseb/testcase
; npm version = 10.9.0
; cwd = /home/regseb/dev/testcase
; HOME = /home/regseb
; Run `npm config ls -l` to show all defaults.

Activity

  1. added
    Bug
    Needs Triage
    on Oct 29, 2024
  2. milaninfy commented on Oct 30, 2024

    @milaninfy
    Contributor

    Thank you for this report. We already have similer issue open, #4197.
    Closing: If you believe your instance is unique, please provide further clarifying details.

  3. added
    Duplicate
    and removed
    Needs Triage
    on Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDuplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions