How to sync `yarn.lock` with `package.json`?

后端 未结 2 445
情歌与酒
情歌与酒 2020-12-11 14:27

I installed a package with yarn add --dev, run its setup process and during it, the package installed several other packages and added those to package.js

2条回答
  •  长情又很酷
    2020-12-11 15:02

    Run yarn install, or just yarn.

    The lock file is updated in its entirety on any change to dependencies, i.e. when you run a yarn command.

    From the Yarn docs:

    Your yarn.lock file is auto-generated and should be handled entirely by Yarn. As you add/upgrade/remove dependencies with the Yarn CLI, it will automatically update your yarn.lock file. Do not edit this file directly as it is easy to break something.

    (Emphasis my own)

提交回复
热议问题