Skip to content
Latchkey

npm EBADENGINE for a Specific Node Range - Fix a Single Over-Tight Dep

Most EBADENGINE warnings are a broad floor like >=18. The trickier case is a package pinning a narrow window (e.g. >=20.9.0 <21), where a Node that is otherwise "new enough" still misses by a point release.

What this error means

EBADENGINE names one specific package and a tight node range your CI Node falls just outside of - a minor/patch below the floor, or a major above the ceiling. Other dependencies are happy; only this one complains.

npm output
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: 'strict-tool@2.1.0',
npm warn EBADENGINE   required: { node: '>=20.9.0 <21' },
npm warn EBADENGINE   current: { node: 'v20.5.0' }
npm warn EBADENGINE }

Common causes

One dependency pins a narrow Node window

A package declares a tight range (a minimum patch plus an upper bound). A Node version inside the right major but below the patch floor - or above the ceiling - is rejected.

CI Node drifted off the exact line

A setup-node node-version: 20 resolves to whatever the latest 20.x is, which can be below a >=20.9.0 floor or, if the dep caps at <21, fine - small drift breaks the narrow window.

How to fix it

Pin CI Node to satisfy the narrow range

Use an exact version inside the dependency’s window rather than a loose major.

Workflow
# GitHub Actions - pin to a version inside the required window
- uses: actions/setup-node@v4
  with:
    node-version: '20.11.1'

Decide if the package is worth the constraint

  1. Check whether a newer release of the dependency widens its engines range.
  2. If only this one package is over-tight and you have verified compatibility, weigh upgrading it vs pinning Node.
  3. Do not flip global engine-strict off to silence a single dep - fix the version.

How to prevent it

  • Pin an exact Node version (or .nvmrc) rather than a loose major.
  • Track dependencies that declare narrow engine windows.
  • Upgrade such deps when they relax their range.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →