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

npm / arborist / #735

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 12 Feb 2021 04:52PM 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
#735

push

isaacs
Allow --force to override conflicted peerOptional

With a dependency graph like this:

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

We do not install the peerOptional dependency by default, so even though
`b@2` is included in the peerSet of `a`, it is not added to the tree.

Then, the `b@1` dependency is added to satisfy root's direct dependency
on it, causing the `a -> b@2` edge to become invalid.

We then try to resolve the `a -> b@2` edge, and find that we cannot
place it anywhere, causing an `ERESOLVE` error.

However, because `b@2` is no longer a part of a peerSet sourced on the
`root` node, we miss the chance to detect that it should be overridden,
resulting in an `ERESOLVE` failure even when `--force` is used.

This commit adds the check for `this[_force]` prior to crashing with
ERESOLVE, so that cases that avoid our earlier heuristics still accept
the invalid resolution when `--force` is in effect.

Fix: #226
Fix: https://github.com/npm/cli/issues/2504

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

2769 of 2769 branches covered (100.0%)

Branch coverage included in aggregate %.

3781 of 3781 relevant lines covered (100.0%)

567.97 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #735.1 12 Feb 2021 04:52PM UTC 0
100.0
Source Files on build #735
  • Tree
  • List 39
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 1d68907d 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

© 2025 Coveralls, Inc