I deleted it by accident and have made many changes to package.json
since. An npm install
or npm update
do not generate package-lock.json
anymore. I tried clearing my npm cache and my nvm cache, but nothing seems to be working. I tried it on several versions of Node.js (6.10.3 Node.js - 3.10.10 npm is what I would like it to work on), and it doesn't work on any.
Is there a way to force npm to generate the package-lock.json
file?
package-lock.json
is generating automatically by default in npm starting from v5, in the previous versions, the lock file name wasnpm-shrinkwrap.json
and it was generated manually usingnpm shrinkwrap
command. – Wilonenode 8.6.0
and with itnpm 5.3.0
and it worked. – Gastrolith.gitignore
. I accidentally hadpackage-lock.json
in the.gitignore
somehow and becausepackage-lock.json
wasn't showing up in thegit status
it was throwing me off. – Packingyarn install --mode update-lockfile
for yarn,pnpm i --lockfile-only
for pnpm, via #44438803 – Maniple