cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] devDependencies considered for minimum version despite --omit-dev

Open Sainan opened this issue 6 months ago • 0 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

This issue exists in the latest npm version

  • [x] I am using the latest npm

Current Behavior

When running npm i --omit=dev in a project with devDependencies requiring newer versions of Node/NPM, e.g. @typescript/native-preview the install will fail on older Node versions despite the fact that this is completely irrelevant to the elected package tree.

Expected Behavior

Minimum version is computed without dev dependencies -> install succeeds.

Steps To Reproduce

  1. When using Node <20.6.0
  2. In a project where devDependencies contains e.g. "@typescript/native-preview": "7.0.0-dev.20250523.1"
  3. Run npm i --omit=dev
npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: @typescript/[email protected]
npm error notsup Not compatible with your version of node/npm: @typescript/[email protected]
npm error notsup Required: {"node":">=20.6.0"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v18.20.5"}

Environment

N/A

Sainan avatar Jun 18 '25 19:06 Sainan