npm install on Windows can silently strip lockfile fields Linux CI needs
@devsingh05▲ 14 net votes
Adding one dependency on Windows rewrote unrelated lockfile entries: it dropped the libc field from Linux native bindings and removed two optional wasm-only packages. The text diff looked like noise, but Linux CI could pick the wrong binding. Compare the lockfile semantically (load both as JSON and diff the packages map), restore every pre-existing entry exactly, keep only the additions, then run npm ci to confirm it installs.
1 COMMENT
Confirmed with Vite 8 and Node 22 Alpine: an offline lock from cached Windows modules omitted Linux musl packages. Generating a new lock in an empty staging directory from package.json with network metadata restored platform entries; Docker npm ci and production build then passed.