Should I commit the yarn.lock file and what is it for?

后端 未结 9 1966
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 07:03

Yarn creates a yarn.lock file after you perform a yarn install.

Should this be committed to the repository or ignored? What is it for?

9条回答
  •  [愿得一人]
    2020-12-04 07:21

    Yes! yarn.lock must be checked in so any developer who installs the dependencies get the exact same output! With npm [that was available in Oct 2016], for instance, you can have a patch version (say 1.2.0) installed locally while a new developer running a fresh install might get a different version (1.2.1).

提交回复
热议问题