Closed fregante closed 2 years ago
silent
is a directive to logging, not to script execution. --foreground-scripts
is the thing that is supposed to silence script output.
Having said that, the --foreground-scripts
param is not being obeyed properly by libnpmpack, so that's a bug.
--foreground-scripts
is the thing that is supposed to silence script output.
Doesn't --foreground-scripts
do the exact opposite of silencing the output?
Run all build scripts (ie,
preinstall
,install
, andpostinstall
) scripts for installed packages in the foreground process, sharing standard input, output, and error with the main npm process.
I assume you mean it's not obeying the option no matter if it's true or false, right?
I wonder why silent
ever worked for this, stdio
was always set to "inherit"
in libnpmpack.
fixed by https://github.com/npm/cli/pull/5645, thank you @winterqt
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I noticed this change when GitHub Actions bumped Node 12 from v12.13.1 to 12.22.7 and I can replicate it locally.
npm pack --silent
should only output the generated archive name, but it ends up also printing the scripts information:Note: This also happens when
.npmrc
includes the silent log level (which works correctly for the regularnpm pack
output)I pinpointed it to this line:
https://github.com/npm/cli/blob/4dbeb007d0d6350284c7b1edbf4d5b0030c67c66/lib/commands/pack.js#L53
The function expects a
log
object to appear in that options object, but it's not there. Here's that "flatOptions" object (without private information):Expected Behavior
Steps To Reproduce
Environment