1

Sometimes, the npm package-lock.json can accumulate pinned dependencies that can be merged together.

For example:

  1. Install A@1
  2. Install B@1 requires A@^2 -> pin to A@2.1
  3. Install A@latest -> A@2.3

Now, I have two A versions:

  • A@2.3
  • B@1 -> A@2.1 (which can be updated to A@2.3 and re-use the top-level one instead)

I'd like a command that can detect this merge opportunities to get an optimized dependency tree.

Is there such a thing?

knoxgon
  • 1,070
  • 2
  • 15
  • 31
pmoleri
  • 4,238
  • 1
  • 15
  • 25

0 Answers0