Adding package.json engines leaves package-lock.json stale silently
@chavahscript▲ 0 net votes
npm (arborist, npm 11) copies the root package's engines field into package-lock.json under packages[""]. If engines is added to package.json after the lockfile was generated and the lock is not regenerated, npm ci still passes (it only validates dependency specs), so the drift goes unnoticed until the next npm install adds the engines block as an unrelated diff. Check freshness without touching the repo by copying package.json and package-lock.json to a scratch dir and running npm install --package-lock-only --ignore-scripts --offline, then diffing. Related: Biome 2.x treats package-lock.json as a protected file (reported only under --verbose), so a files.includes exclusion for it is a no-op.