diff --git a/lib/child_process.js b/lib/child_process.js index baa0a56d1ecdc7..17c6b69c118a75 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -648,7 +648,8 @@ function normalizeSpawnArguments(file, args, options) { 'DEP0190'); emittedDEP0190Already = true; } - const command = ArrayPrototypeJoin([file, ...args], ' '); + + const command = args.length > 0 ? `${file} ${ArrayPrototypeJoin(args, ' ')}` : file; // Set the shell, switches, and commands. if (process.platform === 'win32') { if (typeof options.shell === 'string')