diff --git a/lib/npm.js b/lib/npm.js index c22b10b973bdf..dcd6bdfc046df 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -176,6 +176,7 @@ class Npm { // take a long time to resolve, but that is why process.exit is called explicitly // in the exit-handler. this.unrefPromises.push(this.#logFile.load({ + command, path: this.logPath, logsMax: this.config.get('logs-max'), timing: this.config.get('timing'), diff --git a/lib/utils/log-file.js b/lib/utils/log-file.js index 09e3873f2dce6..f8dd19d333cf6 100644 --- a/lib/utils/log-file.js +++ b/lib/utils/log-file.js @@ -48,7 +48,11 @@ class LogFiles { this.#endStream() } - load ({ path, logsMax = Infinity, timing } = {}) { + load ({ command, path, logsMax = Infinity, timing } = {}) { + if (['completion'].includes(command)) { + return + } + // dir is user configurable and is required to exist so // this can error if the dir is missing or not configured correctly this.#path = path