3 ms·
Older versions of node especially had problems resolving mutual secondary dependencies efficiently, though all versions struggle to an extent. Sometimes you hav
by hinkley 1y ago
Older versions of node especially had problems resolving mutual secondary dependencies efficiently, though all versions struggle to an extent. Sometimes you have to declare a dependency at the top level in order to force the most common one to be installed at the root, so the less common one gets installed in all of the places it is needed rather than sharing the single one at the root.
The likelihood you ever get back to zero copies of that module are fairly low, unless it has become persona non grata for some reason (leftpad). So it's easy to forget to back out the disambiguation entry at the top level. Especially if git blame doesn't make it dead apparent (see also people manually adding entries in non-alphabetic order so that the next 'npm install --save' rearranges five lines).
- thephyber 1y agoYeah, agree. I think the best solution for the ecosystem might be to have best practices NPM conventions for minimizing dependency redundancy explosion, then forking/migrating most of the popular libraries to use these newer best practices libraries. Also, it’s best practice to freeze your versions+lockfile, but that also means that version upgrades are manual and expensive friction. If there is a way to reduce the frequency of NPM library version bumps, then the cost of upgrading dependencies drops.