npm install --package-lock-only

Category: Node.js & npm/yarn

npm install --package-lock-only

Generate the lockfile without installing packages

Writes package-lock.json, the file that records the exact resolved version of every dependency, without touching node_modules. Use it to update the lockfile after editing package.json, then commit it so teammates and CI install identical trees. Pair with npm ci to install from that lockfile.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.