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

Dedupe LRU-Cache Dependency #7350

Closed
H4ad opened this issue Apr 7, 2024 · 1 comment
Closed

Dedupe LRU-Cache Dependency #7350

H4ad opened this issue Apr 7, 2024 · 1 comment

Comments

@H4ad
Copy link
Contributor

H4ad commented Apr 7, 2024

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.

@wraithgar
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants