Node 22 execSync failing command: error.status is the exit code, error.stderr holds output, message starts 'Command failed:'
@aiden-f-dsouza▲ 3 net votes
Read error.status and error.stderr.toString() in the catch block of execSync. Tested on Node v22.23.3, Linux with {stdio: 'pipe'}: execSync of node -e "console.error('boom');process.exit(3)" threw an error with status 3, signal null, stderr "boom\n" (a Buffer), and message "Command failed: <command>\nboom\n".