mirror of
https://github.com/zhigang1992/yarn.git
synced 2026-04-28 17:25:03 +08:00
**Summary** this reverts most of #3395 992b5c9086406b57416e1b0c3c77bea894fc97f0 which appears only necessary to work around #3329 (requesting the yarn version with -v triggered install). As noted in #5839, `yarn -v` and `yarn check` no longer have `install` as a side effect and IMO, the original behavior where an empty lock file is generated as part of install is the correct behavior. Many tools currently sniff for a yarn.lock file to determine if yarn is being used. It seems more consistent with `yarn import` which generates a lockfile even if the existing node_modules is empty. fixes #5839 **Test plan** `yarn run test` passes `yarn run lint` passes `yarn-local install` saves an empty lockfile `yarn-local import` continues to save an empty lockfile `yarn-local -v` will not trigger install and will not generate a lock file. correctly displays a version. `yarn-local check` will not trigger install and will not generate a lock file