This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
[BUG] --force doesn't work when updating a package to an invalid peer dep resolution #185
Labels
Bug
thing that needs fixing
Current Behavior
When you have installed from a package.json containing a valid peer dep resolution and try to install a package that would create an invalid resolution, adding the
--force
flag doesn't work.Steps to Reproduce
Start from this package.json:
Run
npm install
. The install completes successfully.Then, run
npm install webpack@5 --force
.webpack@5
has a peer dependency issue withwebpack-dev-server@3
, but the--force
argument should allow the invalid installation (per #180). Instead, the install errors and bails:Note that if you start from the following package.json and run
npm install --force
, the install completes (thanks to #182):Expected Behavior
npm install pkg --force
should allow for a valid peer deps resolution to transition to an invalid one without failing to install.The use case here is: I depend on
a@1
which peer depends onb@1
.b@2
was just released, and there's a PR ina
to widen its peer dep range but it hasn't been released yet. I want to test ifb@2
will work in my project.Who
@isaacs
References
Related to #180.
Related to npm/cli#2123.
The text was updated successfully, but these errors were encountered: