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 versions
- version
1.0 support node >=v14
- version
1.1 support node >=v14
- version
2.0 support node >=v16
- version
2.1 support node >=v16
installing my-package@^1||^2 in a multi-version-range manner with option engine-strict enabled:
- done on a node14 env: does not install anything, errors that version
2.1 is not supported by the current engine
- done on a node16 env: installs version
2.1 with no problems
Expected Behavior
npm installer detects the highest engine-compatible version and installed it.
installing my-package@^1||^2 in a multi-version-range manner with option engine-strict enabled:
- done on a node14 env: installs version
1.1 with no problems
- done on a node16 env: installs version
2.1 with no problems
Steps To Reproduce
Prerequisite: normalize-package-data@^3 supports node14 as of
https://github.com/npm/normalize-package-data/blob/4121d78eb9d17a2ff738582de48429f8a84dd2c4/package.json#L38-L40
- In a fresh node14 environment
- Run
npm init -y
- RUN
npm i --engine-strict 'normalize-package-data@^3||^4||^5||^6'
- See error
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: normalize-package-data@6.0.0
npm ERR! notsup Not compatible with your version of node/npm: normalize-package-data@6.0.0
npm ERR! notsup Required: {"node":"^16.14.0 || >=18.0.0"}
npm ERR! notsup Actual: {"npm":"9.8.1","node":"v14.21.3"}
npm ERR! A complete log of this run can be found in: .../.npm/_logs/2023-08-28T08_34_08_802Z-debug-0.log
Environment
- npm:
9.8.1 -- tested also with npm@[6,7,8,9,10].x latest version each.
- Node.js:
v14.21.3
- OS Name:
Linux 5206377178b3 6.2.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 12 22:39:51 UTC 2023 x86_64 GNU/Linux
- System Model Name: docker
node:14
- npm config:
; node bin location = /usr/local/bin/node
; node version = v14.21.3
; npm local prefix = /tmp/dsdsadsd
; npm version = 9.8.1
; cwd = /tmp/dsdsadsd
; HOME = /...
; Run `npm config ls -l` to show all defaults.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
given: a package
my-packageexists in multiple versions1.0support node>=v141.1support node>=v142.0support node>=v162.1support node>=v16installing
my-package@^1||^2in a multi-version-range manner with optionengine-strictenabled:2.1is not supported by the current engine2.1with no problemsExpected Behavior
npm installer detects the highest engine-compatible version and installed it.
installing
my-package@^1||^2in a multi-version-range manner with optionengine-strictenabled:1.1with no problems2.1with no problemsSteps To Reproduce
Prerequisite:
normalize-package-data@^3supports node14 as ofhttps://github.com/npm/normalize-package-data/blob/4121d78eb9d17a2ff738582de48429f8a84dd2c4/package.json#L38-L40
npm init -ynpm i --engine-strict 'normalize-package-data@^3||^4||^5||^6'Environment
9.8.1-- tested also withnpm@[6,7,8,9,10].xlatest version each.v14.21.3Linux 5206377178b3 6.2.0-27-generic #28-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 12 22:39:51 UTC 2023 x86_64 GNU/Linuxnode:14