[BUG] npm
sometimes unexpected overrides peer dependencies, resulting in an invalid tree
#7509
Open
2 tasks done
Labels
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
In some cases when attempting to upgrade packages that involve peer dependencies that conflict instead of erroring
npm
will decide to override peer dependencies (which is emitted as a warning), resulting in a tree that will then error when runningnpm install
afterwards:I've had this happen from time-to-time over the last couple of years, but only just gotten around to submitting a bug report - I think generally I've seen this happen with packages like
@typescript-eslint
,jest
, andwebpack
, though I don't have a reproduction involving them right now.Expected Behavior
I expect
npm
to explode upfront rather than generate a tree it knows will be invalid, unless I provide--legacy-peer-deps
Steps To Reproduce
Environment
npx npm@latest
too (v10.7.0 at time of writing)The text was updated successfully, but these errors were encountered: