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

npm / arborist / #735 / 1

Build:
Build:
LAST BUILD BRANCH:
DEFAULT BRANCH: master
Ran 12 Feb 2021 04:52PM UTC
Files 39
Run time 3s
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

12 Feb 2021 04:49PM UTC coverage: 100.0%. Remained the same
#735.1

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

Source Files on job #735.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 735
  • 1d68907d on github
  • Prev Job for on (##734.1)
  • Next Job for on (##736.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