[BUG] npm install
does not detect engine-compatible package properly
#6743
Labels
Bug
thing that needs fixing
Needs Triage
needs review for next steps
Release 9.x
work is associated with a specific npm 9 release
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
given: a package
my-package
exists in multiple versions1.0
support node>=v14
1.1
support node>=v14
2.0
support node>=v16
2.1
support node>=v16
installing
my-package@^1||^2
in a multi-version-range manner with optionengine-strict
enabled:2.1
is not supported by the current engine2.1
with no problemsExpected Behavior
npm installer detects the highest engine-compatible version and installed it.
installing
my-package@^1||^2
in a multi-version-range manner with optionengine-strict
enabled:1.1
with no problems2.1
with no problemsSteps To Reproduce
Prerequisite:
normalize-package-data@^3
supports node14 as ofhttps://github.com/npm/normalize-package-data/blob/4121d78eb9d17a2ff738582de48429f8a84dd2c4/package.json#L38-L40
npm init -y
npm i --engine-strict 'normalize-package-data@^3||^4||^5||^6'
Environment
9.8.1
-- tested also withnpm@[6,7,8,9,10].x
latest version each.v14.21.3
Linux 5206377178b3 6.2.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 12 22:39:51 UTC 2023 x86_64 GNU/Linux
node:14
The text was updated successfully, but these errors were encountered: