profile
viewpoint

Ask questionsYarn outputs script meta-information to stdout instead of stderr

<!-- Before creating an issue please make sure you are using the latest version of yarn. -->

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

When you run a script via yarn some-script, yarn outputs meta-information like "yarn run v1.12.3" and "Done in 0.06s" to stdout. This makes it inconvenient when you want to pipe the output of the script somewhere, since it's included in that pipe. If yarn were to output to stderr, this would not be an issue -- and would be more respectful of the script's output.

If the current behavior is a bug, please provide the steps to reproduce.

Here's a tiny repository illustrating this issue: https://github.com/wcauchois/yarn-stderr-repro

$ yarn some-script > ./hello.txt
$ cat hello.txt
yarn run v1.12.3
$ echo hi from some script!
hi from some script!
Done in 0.06s.

What is the expected behavior?

I would expect hello.txt in that case to consist only of the string "hi from some script!"

Please mention your node.js, yarn and operating system version.

$ node --version
v10.7.0
$ yarn --version
1.12.3
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.14
BuildVersion:	18A391

Thanks!

yarnpkg/yarn

Answer questions bolinfest

This doesn't answer the question of why yarn run writes to stderr rather than stdout by default. This is not particularly command-line friendly.

useful!

Related questions

'yarn' is not recognized as an internal or external command, operable program or batch file. hot 3
Yarn slow fetching, linking hot 3
Yarn link doesn't work hot 3
Error: Couldn't find the binary git hot 3
yarn fails to install fsevents while npm succeeds hot 2
An unexpected error occurred: "https://registry.yarnpkg.com/<package>: Not found" hot 2
yarn add `node-sass` never finish hot 2
Windows 10 v1709, node_modules/.bin losing permissions hot 2
Yarn add hangs building fresh packages for Puppeteer hot 2
Cannot authenticate in npm registry using _authToken hot 2
add: Cannot add any module that is also an option. hot 2
`yarn install --ignore-engines` makes it impossible to pass `yarn check --integrity --verbose` hot 1
`yarn install --force` not overwriting yarn.lock when `--frozen-lockfile true` set in .yarnrc hot 1
EPROTO: protocol error, symlink &#39;../acorn/bin/acorn&#39; - yarn hot 1
If .yarnrc is hidden on Windows, yarn add [package] fails hot 1
Github User Rank List