Lerna bootstrap swallows stdout and stderr output from NPM client
See original GitHub issueWhen running lerna bootstrap
, any output (e.g., logs, warnings, errors) from the underlying NPM client are swallowed. This results in failed bootstraps without knowing the reason the underlying client exited with a non-zero status code. Also, warnings like misconfigured peer dependencies are never displayed to the end user.
Expected Behavior
Running lerna bootstrap
should pass through output from the underlying NPM client.
Current Behavior
lerna bootstrap
swallows all output from the underlying NPM client.
Possible Solution
If it’s not desired to make lerna bootstrap
more verbose, perhaps only stderr can be let pass through and stdout can be enabled by adding a new --npm-client-stdout
flag?
Steps to Reproduce (for bugs)
- Set up a Lerna project using
lerna init
- Create a new package using
lerna create
- Add a non-existent dependency to the newly created package’s package.json
- Run
lerna bootstrap
lerna.json
{
"lerna": "2.9.0",
"version": "independent",
"npmClient": "yarn"
}
Context
I’m managing private packages in a monorepo and often there are issues with local dependencies not being resolved by the underlying NPM client. lerna bootstrap
fails silently without a clear indication of what the error is.
Your Environment
Executable | Version |
---|---|
lerna --version |
3.20.2 |
npm --version |
6.4.1 |
yarn --version |
1.18.0 |
node --version |
10.14.2 |
OS | Version |
---|---|
macOS Catalina | 10.15.3 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:10
Top GitHub Comments
👍 Stuck investigating random hangs for the last hour with no solution to see where npm install is hanging.
Looking at the code couldn’t see any user option that could change that behavior.
If you need to troubleshoot bootstrap issues I’d suggest to temporarily replace that
stdio = "pipe"
for astdio = "inherit"
:https://github.com/lerna/lerna/blob/a47fc294393a3e9507a8207a5a2f07648a524722/utils/npm-install/npm-install.js#L17
@evocateur would you accept a PR making inherit the default?