Tasks that succeed or tasks that fail with --no-bail enabled simply discard stderr output. This output is important and discarding it can make figuring out what is happening in running tasks very difficult.
https://github.com/lerna/lerna/blob/master/commands/run/index.js#L167
stderr is reported for successful tasks.
stderr is only logged if a task fails.
Always log stderr in the above linked method.
test that logs to stdout and stderr while returning a 0 exit codelerna run teststderr is not output| Executable | Version |
| ---: | :--- |
| lerna --version | 3.15.0 |
| node --version | v10.13.0 |
Messages sent to stderr does not mean the process encountered an error. That's what process.exitCode/process.exit(code) is for.
Well-behaved CLI programs emit logging to stderr, which is generally extremely noisy and can become almost worthless in a parallel execution that lerna often creates.
If you _want_ this situation, it seems like you're really looking for --stream (add --concurrency 1 --no-prefix to reduce the interleaving, maybe).
The change in the linked PR is strictly to the batched mode. I agree it doesn't mean it's an error, but frequently it contains useful information (at least in my repo) and the lack of it makes it really hard to debug when I run scripts across my 50+ packages.
The biggest failure mode for me is when I want to run all of the tests in my repo and then review all the failures (common after a big framework change). Then I'll use lerna run test --no-bail so that I don't have to run lerna run test over and over again. However, all of the useful errors are sent to stderr, which is then dropped when --no-bail is present.
If I restricted my change to only log stderr when this.bail === false would that make you more comfortable with it?
Most helpful comment
The change in the linked PR is strictly to the batched mode. I agree it doesn't mean it's an error, but frequently it contains useful information (at least in my repo) and the lack of it makes it really hard to debug when I run scripts across my 50+ packages.
The biggest failure mode for me is when I want to run all of the tests in my repo and then review all the failures (common after a big framework change). Then I'll use
lerna run test --no-bailso that I don't have to runlerna run testover and over again. However, all of the useful errors are sent tostderr, which is then dropped when--no-bailis present.