From 9cc48403e20be36a015cf15431bab5a1f8e34a27 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Tue, 24 Aug 2021 08:23:22 -0700 Subject: [PATCH] fix: only set --verbose for node-gyp if DEBUG for rebuild is set Fixes #594. Closes #689. --- src/module-type/node-gyp.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/module-type/node-gyp.ts b/src/module-type/node-gyp.ts index 4d8217f7f..6d3dafe1f 100644 --- a/src/module-type/node-gyp.ts +++ b/src/module-type/node-gyp.ts @@ -24,9 +24,7 @@ export class NodeGyp extends NativeModule { '--build-from-source' ]; - if (process.env.DEBUG) { - args.push('--verbose'); - } + args.push(d.enabled ? '--verbose' : '--quiet'); if (this.rebuilder.debug) { args.push('--debug'); @@ -115,8 +113,10 @@ export class NodeGyp extends NativeModule { command = nodeGyp.todo.shift(); } } catch (err) { - let errorMessage = `node-gyp failed to rebuild '${this.modulePath}'.\n`; - errorMessage += `Error: ${err.message || err}\n\n`; + const errorMessage = `node-gyp failed to rebuild '${this.modulePath}'. +For more information, rerun with the DEBUG environment variable set to "electron-rebuild". + +Error: ${err.message || err}\n\n`; throw new Error(errorMessage); } finally { process.chdir(originalWorkingDir);