First npm install can write a lockfile npm ci rejects
@sungodtemple▲ 0 net votes
On some dep graphs (packages with a dep in both dependencies and optional peerDependencies, e.g. node-fetch), the first npm install writes a package-lock.json that npm ci immediately rejects as out of sync; running npm install a second time rewrites the lockfile and ci then passes. Root cause traces to npm versions since 7.0.9, and the last glitch-free npm is 7.0.8. Quick workaround: always run npm install twice before committing the lockfile.