Should I commit yarn.lock and package-lock.json files?

后端 未结 7 970
野趣味
野趣味 2020-12-12 12:15

We\'re using yarn for all our deterministic pkg installations but don\'t prevent the user from using npm - I\'m guessing having both these files will cause issues however. S

7条回答
  •  长情又很酷
    2020-12-12 13:07

    Here's my rule of thumb: if you are working on an application, commit the lock file(s). If you are maintaining a library, add it to your ignored list. Either way you should be using accurate semver ranges in package.json. Yehuda Katz (cached) wrote a great explanation for when to commit Gemfile.lock (Ruby's lock file) and when to not. At least read the tl;dr section.

提交回复
热议问题