Is there a way to force npm to generate package-lock.json?

后端 未结 7 618
Happy的楠姐
Happy的楠姐 2021-01-30 05:59

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

相关标签:
7条回答
  • 2021-01-30 06:43

    As several answer explained the you should run:

    npm i

    BUT if it does not solve...

    Check the version of your npm executable. (For me it was 3.x.x which doesn't uses the package-lock.json (at all))

    npm -v

    It should be at least 5.x.x (which introduced the package-lock.json file.)

    To update npm on Linux, follow these instructions.

    For more details about package files, please read this medium story.

    0 讨论(0)
提交回复
热议问题