Skip to content

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

Open
@Sainan

Description

@Sainan

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • 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/native-preview@7.0.0-dev.20250523.1
npm error notsup Not compatible with your version of node/npm: @typescript/native-preview@7.0.0-dev.20250523.1
npm error notsup Required: {"node":">=20.6.0"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v18.20.5"}

Environment

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions