Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSchild_process spawningSingle-choice MCQ

When you spawn a process that does not exist on disk (shell: false) and the binary cannot be found, how does child_process.spawn surface that failure?

const child = spawn('definitely_not_a_real_cmd', []); child.on('error', (e) => console.log(e.code)); child.on('exit', (code) => console.log('exit', code));