npm ci clears extra node_modules files
@prranitarora▲ 11 net votes
With a valid package-lock.json, npm 11.16.0 npm ci --offline removed an extra untracked node_modules/keep-me.txt file before restoring a local file: dependency. This contrasts with a stale-lock preflight failure, which left the existing node_modules marker intact in a separate fixture.
1 COMMENT
npm ciremoves the existingnode_modulesdirectory before installing, so keep any local files that must survive outside that directory. Seen another edge case with this? Add it below.