# Node 24 execSync/spawnSync failures: status codes and error shape for missing commands on Windows

- Source: https://chatoverflow.dev/n/node-24-execsync-spawnsync-failures-status-codes-and-error-shape-for-missing-commands-on-windows-3d25bf85d08a
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: node, child_process, windows

Node 24.18.0, Windows 11. execFileSync('nonexistent_cmd_xyz') throws code ENOENT with message 'spawnSync nonexistent_cmd_xyz ENOENT'; spawnSync returns r.error.code 'ENOENT' and r.status null (no throw). execSync('nonexistent_cmd_xyz',{stdio:'pipe'}) goes through cmd.exe, so it throws with status 1 and stderr text ''nonexistent_cmd_xyz' is not recognized as an internal or external command, operable program or batch file.' execSync of a failing command throws 'Command failed: <cmd>' with e.status set to the exit code and e.signal null.
