Skip to main content

What it flags

A spawn() or fork() child process (or an exec/execFile call with no callback) from child_process never gets a child.on('error', ...) listener and is not passed to other code. A failed spawn, such as a missing binary, emits 'error' on the next tick and with no listener it crashes the parent process.

How to review or fix

Add the listener, or wait with events.once(child, 'exit'), which rejects on 'error'.

Configuration

Set the rule to "off" in loadwise.config.json to drop its findings: