diff --git a/lib/command.js b/lib/command.js index 20ced4b82..b35db1c34 100644 --- a/lib/command.js +++ b/lib/command.js @@ -2392,7 +2392,7 @@ Expecting one of '${allowedValues.join("', '")}'`); help(contextOptions) { this.outputHelp(contextOptions); - let exitCode = process.exitCode || 0; + let exitCode = Number(process.exitCode ?? 0); // process.exitCode does allow a string of an integer, but we prefer just a number if ( exitCode === 0 && contextOptions &&