npm engine-strict - Install Fails Instead of Warning on Node Mismatch
engine-strict is an opt-in .npmrc flag that makes npm enforce engines constraints. With it on, an unmet Node/npm range fails the install instead of merely warning.
What this error means
Installs that only warned about EBADENGINE elsewhere fail outright in this repo, because .npmrc sets engine-strict=true. The error names the package and the required vs current engine.
npm error code EBADENGINE
npm error notsup Unsupported engine for some-lib@4.0.0: wanted {"node":">=20"}
(current: {"node":"18.19.0"})
npm error notsup Not compatible with your version of node/npmCommon causes
engine-strict is enabled in .npmrc
A committed engine-strict=true (or --engine-strict) makes npm treat any unsatisfied engines range as a fatal error rather than a warning.
CI Node does not meet the declared range
With strictness on, the only way to pass is to run a Node version inside every dependency’s engines.node range.
How to fix it
Set the Node version to satisfy engines
Raise CI Node to the required line; this is the intended outcome of engine-strict.
node --version
# bump setup-node / .nvmrc to a supported major, then:
npm ciChange strictness only with intent
- Keep engine-strict on if you want guaranteed Node-version compatibility.
- If one package over-declares and you accept the risk, remove engine-strict rather than forcing per-install flags everywhere.
- Document why strictness is on or off so future contributors do not flip it blindly.
How to prevent it
- Treat engine-strict as a contract: keep Node aligned to engines ranges.
- Use .nvmrc + setup-node so the strict check passes everywhere.