Skip to content

Dedupe LRU-Cache Dependency #7350

Closed
Closed

Description

@H4ad

The current output of npm ls lru-cache for this repo:

npm@10.5.1 /home/h4ad/Projects/opensource/performance-analysis/npm-cli
├─┬ @npmcli/git@5.0.4
│ └── lru-cache@10.2.0
├─┬ @npmcli/template-oss@4.21.3
│ ├─┬ @commitlint/cli@18.6.1
│ │ └─┬ @commitlint/read@18.6.1
│ │   └─┬ git-raw-commits@2.0.11
│ │     └─┬ meow@8.1.2
│ │       └─┬ normalize-package-data@3.0.3
│ │         └─┬ hosted-git-info@4.1.0
│ │           └── lru-cache@6.0.0
│ └─┬ release-please@16.3.1
│   └─┬ conventional-changelog-writer@6.0.1
│     └─┬ meow@8.1.2
│       └─┬ normalize-package-data@3.0.3
│         └─┬ hosted-git-info@4.1.0
│           └── lru-cache@6.0.0
├─┬ cacache@18.0.2
│ └── lru-cache@10.2.0 deduped
├─┬ glob@10.3.12
│ └─┬ path-scurry@1.10.2
│   └── lru-cache@10.2.0 deduped
├─┬ hosted-git-info@7.0.1
│ └── lru-cache@10.2.0 deduped
├─┬ licensee@10.0.0
│ └─┬ @npmcli/arborist@6.5.0
│   ├─┬ @npmcli/package-json@4.0.1
│   │ └─┬ @npmcli/git@4.1.0
│   │   └── lru-cache@7.18.3 deduped
│   ├─┬ @npmcli/run-script@6.0.2
│   │ └─┬ node-gyp@9.4.1
│   │   └─┬ make-fetch-happen@10.2.1
│   │     ├─┬ cacache@16.1.3
│   │     │ └── lru-cache@7.18.3 deduped
│   │     └── lru-cache@7.18.3 deduped
│   ├─┬ cacache@17.1.4
│   │ └── lru-cache@7.18.3
│   ├─┬ hosted-git-info@6.1.1
│   │ └── lru-cache@7.18.3 deduped
│   ├─┬ npm-registry-fetch@14.0.5
│   │ └─┬ make-fetch-happen@11.1.1
│   │   └── lru-cache@7.18.3 deduped
│   └─┬ pacote@15.2.0
│     └─┬ sigstore@1.9.0
│       ├─┬ @sigstore/sign@1.0.0
│       │ └─┬ make-fetch-happen@11.1.1
│       │   └── lru-cache@7.18.3 deduped
│       ├─┬ @sigstore/tuf@1.0.3
│       │ └─┬ tuf-js@1.1.7
│       │   └─┬ make-fetch-happen@11.1.1
│       │     └── lru-cache@7.18.3 deduped
│       └─┬ make-fetch-happen@11.1.1
│         └── lru-cache@7.18.3 deduped
├─┬ make-fetch-happen@13.0.0
│ └─┬ @npmcli/agent@2.2.1
│   └── lru-cache@10.2.0 deduped
├─┬ semver@7.6.0
│ └── lru-cache@6.0.0
└─┬ tap@16.3.10
  ├─┬ @isaacs/import-jsx@4.0.1
  │ └─┬ @babel/core@7.23.6
  │   └─┬ @babel/helper-compilation-targets@7.23.6
  │     └── lru-cache@5.1.1
  └─┬ nyc@15.1.0
    └─┬ istanbul-lib-instrument@4.0.3
      └─┬ @babel/core@7.23.9
        └─┬ @babel/helper-compilation-targets@7.23.6
          └── lru-cache@5.1.1

There are 4 different versions in the dependency tree, and during the npm run, at least two versions are loaded (one by semver and another for glob.

Activity

  1. wraithgar commented on Apr 24, 2024

    @wraithgar
    Contributor

    We don't really care about dev deps in this context, only production deps

    $ npm query '.prod#lru-cache'|json -a location
    node_modules/lru-cache
    node_modules/semver/node_modules/lru-cache

    semver is the only real outlier here, there is a PR to fix this. We can track that work over in node-semver.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions