windows-build-tools icon indicating copy to clipboard operation
windows-build-tools copied to clipboard

Silent mode broken

Open jtatum opened this issue 7 years ago • 3 comments

The readme mentions a --silent option for performing silent installs. I see src/logging.js check process.env.npm_config_disable_logging but it looks like the code that sets that variable is missing. Setting that variable suppresses some logging, but not the magic multi-file log printing - I think single-line-log.js also needs to check this variable. In fact, that's mostly what I want to suppress - the terminal control code output is pretty ugly in CI 😄 If there was an option to just suppress the single line log, I'd use it.

jtatum avatar Feb 24 '18 01:02 jtatum

Which command are you running? It's important that --silent is appended right after the npm keyword. Npm will go and turn that into the environment variable you see above.

felixrieseberg avatar Feb 24 '18 03:02 felixrieseberg

Pretty sure I tired that. Since it doesn’t suppress the install logs, it’s possible that I just missed the effect.

jtatum avatar Feb 25 '18 23:02 jtatum

It looks like NPM no longer uses an environment variable for these. --silent is an alias for --loglevel silent, --quiet is an alias for --loglevel warn. npm depends on a package called npmlog. Once the npmlog object is created, lib/npm.js sets .level to the loglevel command line parameter. I don't think anything sets that env var anymore.

https://github.com/npm/npm/blob/latest/lib/npm.js#L291 and https://github.com/npm/npmlog

jtatum avatar Feb 26 '18 18:02 jtatum