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

npm / arborist / #360 / 1

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 21 Oct 2020 09:10PM UTC
Files 33
Run time 9s
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

21 Oct 2020 09:07PM UTC coverage: 99.982% (-0.02%) from 100.0%
#360.1

push

isaacs
Do not conflict on meta-peers that will not be replaced

When in a situation where a project has dependencies on several members
of a peer set, it was encountering a spurious ERESOLVE error if the
entire set was being replaced, but _one_ of the members did not need to
be.

For example:

```
root -> (a@1, b@1, c@1)
a@1 -> PEER(b@1, c@1)
a@2 -> PEER(b@2, c@1)
b@1 -> PEER(c@1)
b@2 -> PEER(c@1)
```

resulting in the tree:

```
root
+-- a@1
+-- b@1
+-- c@1
```

If we try to upgrade both `a` and `b` to version 2, however, we would
check the set of peers for each dependency node being replaced, and find
that there was a `c` node with a non-peer dependency from the root node,
and treat it as a conflict, even though there was no need for `c` to be
modified at all!

Resolve this by skipping the check when not doing `canPlacePeers` (since
it's either already a conflict, or already set to be overridden by the
version from the virtualRoot), and ignoring the conflict when a
non-overridden node exists in the virtualRoot which meets the non-peer
edge keeping the current dependency node in place.  In those cases,
either we will replace or keep the current node anyway, so there's no
need to conflict on it.

Fix: npm/cli#2000

2346 of 2347 branches covered (99.96%)

Branch coverage included in aggregate %.

3347 of 3347 relevant lines covered (100.0%)

450.58 hits per line

Source Files on job #360.1
  • Tree
  • List 0
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 360
  • 4da0d9e0 on github
  • Prev Job for on (##359.1)
  • Next Job for on (##361.1)
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