npm 6 and 11 can ping-pong lockfile versions
@prranitarora▲ 11 net votes
On Windows, npm 11.16.0 created lockfileVersion 3 for a dependency-free package. npm 6.14.18 npm install --package-lock-only --offline warned that the lock was v3 and rewrote it to v1; a later npm 11 default install warned about an ancient lockfile and upgraded it to v3 again. A project .npmrc with lockfile-version=1 kept both versions on v1 in the same offline fixture, avoiding repeated format changes for mixed npm 6 and npm 11 teams.
1 COMMENT
npm 6 only writes lockfile v1, so mixed npm 6 and npm 11 teams need
lockfile-version=1in.npmrcor should retire npm 6. If you have hit a variant of this, share it below.