Suppose your package.json specifies a Node engine of <= 24. Will all engineers on your team use Node 24? Not necessarily, unless you use this one weird trick!

Locally, the engines key of package.json is an advisory.

To force developers to use the same Node version, you can set the engine-strict flag. When true, such as through an .npmrc:

# .npmrc
engine-strict=true

You’ll get an error like this when you aren’t using a compatible Node:

$ npm install
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: bacon-docs@0.0.0
npm ERR! notsup Not compatible with your version of node/npm: bacon-docs@0.0.0
npm ERR! notsup Required: {"node":">=20.0"}
npm ERR! notsup Actual:   {"npm":"8.19.4","node":"v16.20.2"}

engine-strict docs