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

npm / arborist / #731

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 12 Feb 2021 04:40PM UTC
Jobs 1
Files 39
Run time 4s
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
#731

push

isaacs
Do not ERESOLVE on peerOptionals not added to tree

For these dependency graphs:

    # case a
    root -> (x, y@1)
    x -> PEEROPTIONAL(z)
    z -> PEER(y@2)

    # case b
    root -> (x) PEEROPTIONAL(y@1)
    x -> PEEROPTIONAL(y@2)

    # case c
    root -> (x) PEEROPTIONAL(y@1)
    x -> PEER(z)
    z -> PEEROPTIONAL(y@2)

The peerOptional dependency is included in the peerSet, which would
raise an ERESOLVE conflict at the peerSet generation stage, even though
the peerOptional dependencies will not actually be added to the tree.

To address this, this commit tracks the nodes which are actually
required in the peerSet generation phase, by virtue of being
non-optionally depended upon by a required node in the peerSet.

If a conflict occurs on a node which is not in the required set during
the peerSet generation phase, we ignore it in much the same way that we
would ignore peerSet errors in metadependencies or when --force is used.

Of course, if the peerOptional dependency is _actually_ required, to
avoid a conflict with an invalid resolution present in the tree already,
and there is no suitable placement for it, then ERESOLVE will still be
raised.

Fix: #223
Fix: https://github.com/npm/cli/issues/2667

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

2769 of 2769 branches covered (100.0%)

Branch coverage included in aggregate %.

3778 of 3778 relevant lines covered (100.0%)

565.53 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #731.1 12 Feb 2021 04:40PM UTC 0
100.0
Source Files on build #731
Detailed source file information is not available for this build.
  • Back to Repo
  • f3758731 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