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

npm / arborist / #635

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 28 Jan 2021 01:07AM UTC
Jobs 1
Files 39
Run time 7s
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
#635

push

isaacs
Detect conflicts among nested peerOptional deps

We do not normally install optional peerDependencies, so we were
skipping over them when building up the peer set that is evaluated for
placement within the tree.

However, if an optional peer dep _conflicts_ with something in the tree,
then it will be seen as an invalid edge, and attempt resolution.

This results in a problem in the following scenario:

```
root -> (a, x)
a -> b
b -> PEER(k@1)
x -> y
y -> PEEROPTIONAL(k@2)
```

We place a, b, k@1, and x in the root node_modules without incident.

Then, we evaluate y, and did not add `k@2` to its peerSet, because it
is a peerOptional.  Since it does not have any apparent peers to
conflict, it is _also_ placed at the root level.

Then, we look to the invalid edges coming out of `y`, and find `k@2` is
invalid, because it resolves to `k@1`, and there is no place to put it,
because `y` is already in the root level, where the conflict exists, and
we ERESOLVE.

The solution is to include peerOptional edges when creating the peerSet,
but still omit missing peerOptional deps when looking for invalid edges
needing further resolution.

Fix: https://github.com/npm/cli/issues/2265

2722 of 2722 branches covered (100.0%)

Branch coverage included in aggregate %.

3741 of 3741 relevant lines covered (100.0%)

545.17 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #635.1 28 Jan 2021 01:07AM UTC 0
100.0
Source Files on build #635
Detailed source file information is not available for this build.
  • Back to Repo
  • 0172e29f 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