C:\Users\Thomas
位 yarn
yarn install v1.19.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 0.07s.
C:\Users\Thomas
位 ls yarn.lock
yarn.lock
After this i get a yarn.lock new file in my user directory.
When i execute yarn just after fresh install of yarn on Windows 10 home edition 64 bit in Cmder I expect no --help or --version but a compact and reduce help about
C:\Users\Thomas
位 node --version
v12.11.1
C:\Users\Thomas
位 npm --version
6.11.3
C:\Users\Thomas
位 yarn --version
1.19.1
I actually expect it to be shorthand of yarn install, as it always was 馃し鈥嶁檪 It is well documented:
Running
yarnwith no command will runyarn install, passing through any provided flags.
CLI convention (and hence what constitutes "bad CLI practice") varies by OS, and yarn is a multi-platform tool. Hence more objective goals are that it be consistent, ergonomic, and well-documented.
Admittedly, yarn has different semantics than npm, but these are intentional are arguably more ergonomic (e.g. optimized for most common use cases). You wouldn't expect dir (or ls) to print help, usage, or version information when run without arguments, right? Of course not. Instead, it's optimized for the very common use case of listing the contents of the current directory (rather than having to explicitly specific this with a . argument). yarn is similar. By far the most common action needed is installing packages listed in package.json / yarn.lock, so that is what it does when run without arguments.
Besides, even in Windows' cmd.exe there are commands like START or EXIT which take action without any arguments.
This is working as intended as mentioned earlier. Although we appreciate the feedback, we don't have any plans for changing this behavior which would also require a major version bump as it would be a breaking change.
Closing as this is not really actionable.
Most helpful comment
I actually expect it to be shorthand of
yarn install, as it always was 馃し鈥嶁檪 It is well documented:https://yarnpkg.com/en/docs/cli/install