You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug What is the current behavior?
For a project with no dependencies, running yarn aka yarn install will not create a yarn.lock. Instead the message info Lockfile not saved, no dependencies. will be given.
If the current behavior is a bug, please provide the steps to reproduce.
yarn init
yarn
# info Lockfile not saved, no dependencies.
ls yarn.lock
# ls: yarn.lock: No such file or directory
What is the expected behavior?
For a package.json with no dependencies an "empty" yarn.lock should be generated if:
…encies
this reverts most of yarnpkg#3395992b5c9
which appears only necessary to work around yarnpkg#3329 (requesting the yarn
version with -v triggered install)
Since there is actually a message "Lockfile not saved, no dependencies." this seems like it was the intended behavior by whoever wrote it, but I agree that an empty lockfile seems like a good idea. I'll flag this as a feature request.
…5843)
**Summary**
this reverts most of #3395992b5c9 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
Do you want to request a feature or report a bug?
bug
What is the current behavior?
For a project with no dependencies, running
yarn
akayarn install
will not create a yarn.lock. Instead the messageinfo Lockfile not saved, no dependencies.
will be given.If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
For a
package.json
with no dependencies an "empty" yarn.lock should be generated if:yarn
(it does not -- this bug)yarn install
(it does not -- this bug)yarn import
(it does already!)NO yarn.lock and no errors if:
yarn -v
(should not regress Creating yarn.lock file after running "yarn -v" #3329)yarn check
(should not regress yarn check fails if there's no lockfiles, yarn install doesn't generate one without any dependencies #679)Please mention your node.js, yarn and operating system version.
node 6.9.1
yarn 1.6.0
Mac OS 10.13.4
Extra Info
The text was updated successfully, but these errors were encountered: