• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

npm / arborist / #931

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 28 Apr 2021 06:48PM UTC
Jobs 1
Files 39
Run time 20s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
#931

push

isaacs
Prevent and eliminate unnecessary duplicates

When the root package tree bundles its dependencies, previously Arborist
would treat that as a normal bundled dependency (rather than a
transitive dependency bundled _by_ a dependency) and refuse to touch it.

This resulted in a strange situation where npm would stubbornly refuse
to modify the copy of npm-registry-fetch nested underneath its pacote
dependency, even when pacote or nrf were updated explicitly, requiring
the deletion of the node_modules tree in order to resolve properly.

A `canDedupe()` method is added to the Node class, and this is used in
multiple previously (slightly) duplicative code paths where we test to
see if we can dedupe out a nested Node in the tree, thus both preventing
and correcting the unnecessary duplicates that would otherwise have
occurred.

This does introduce the bug/feature/change where now installing a new
package at the top level will cause npm to remove anything nested within
the tree that could be deduped against it, as long as that nested
transitive dependency is not contained in a dep bundle or shrinkwrap.

PR-URL: https://github.com/npm/arborist/pull/271
Credit: @isaacs
Close: #271
Reviewed-by: @nlf

3003 of 3003 branches covered (100.0%)

Branch coverage included in aggregate %.

4050 of 4050 relevant lines covered (100.0%)

563.77 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #931.1 28 Apr 2021 06:48PM UTC 0
100.0
Source Files on build #931
Detailed source file information is not available for this build.
  • Back to Repo
  • 1e8bb2cb on github
  • Prev Build on
  • Next Build on
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc