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

后端 未结 7 688
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:27

    By default, package-lock.json is updated whenever you run npm install. However, this can be disabled globally by setting package-lock=false in ~/.npmrc.

    When the global package-lock=false setting is active, you can still force a project’s package-lock.json file to be updated by running:

    npm install --package-lock
    

    This command is the only surefire way of forcing a package-lock.json update.

提交回复
热议问题