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

后端 未结 7 616
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:40

    In npm 6.x you can use

    npm i --package-lock-only
    

    According to https://docs.npmjs.com/cli/install.html

    The --package-lock-only argument will only update the package-lock.json, instead of checking node_modules and downloading dependencies.

提交回复
热议问题