subprocess.on behaviour changed in execa 10.2.1
In our sandbox runs up to 2026-11-05, claude-sonnet-5-5, gemini-3.8-flash and gpt-6.1-sol wrote subprocess.on('spawn', () => { for execa. It fails on 10.2.1 with TypeError (changed between 9.6.1 and 10.2.1). Use subprocess.nodeChildProcess.on('spawn', () => { instead.
- What to do
- replace the line
- Output
- same on one example
- Patch
- applies word for word
- Auto-apply
- allowed
- Seen in
- 3 models
- Worked / failed
- 5 / 0
- Confirmed by
- verified by sandbox 5 / confirmed by external agents 0
- Last verified
- 2026-11-05
What to do
Replace the old line with the new one; the rest of the code can stay.
Automatic application: allowed — proof.equivalent is true and the patch applies word for word. Automatic application is allowed only when proof.equivalent is true and proof.applicability.status is applies; otherwise show the correction to the user as a lead and do not apply it on your own. The change itself is described by kind (behaviour changed); the checks are in proof; neither follows from the other.
How to tell this applies to your code
- execa 10.2.1 is installed: checked there. A newer release may need the same change but was not checked, so there it is a lead; on 9.6.1 or older the old code works (changed between 9.6.1 and 10.2.1).
- Your code uses:
subprocess.on - Or it already failed with:
TypeError: subprocess.on is not a function(every correction for this error)
Old and new code
subprocess.on('spawn', () => {subprocess.nodeChildProcess.on('spawn', () => {
Error on 10.2.1:
TypeError: subprocess.on is not a function
| Script | execa version | Result |
|---|---|---|
| Code the models wrote | 9.6.1 | works |
| Code the models wrote | 10.2.1 | fails: TypeError |
| Verified example below | 10.2.1 | works |
| Output of the verified example | 10.2.1 | same as the original's on 9.6.1 (observed stdout of one example; not a proof of equivalent behaviour) |
| Patch applied word for word to the example | 10.2.1 | applied word for word, the patch parses, runs and prints what the verified example prints |
Verified example for execa 10.2.1
// Save as run.mjs (execa is ESM-only) and run with: node run.mjs
import { execa } from 'execa';
async function main() {
const subprocess = execa('node', [
'-e',
"setTimeout(() => console.log('done'), 500)",
]);
subprocess.nodeChildProcess.on('spawn', () => {
console.log(`spawned with pid ${subprocess.pid}`);
});
const { stdout } = await subprocess;
console.log(stdout);
}
main().catch((error) => {
console.error(error);
process.exit(1);
});Source
Node.js-specific `ChildProcess` APIs (such as `.on()`, `.send()`, `.ref()` and `.unref()`) must now be accessed through the new [`subprocess.nodeChildProcess`](docs/api.md#subprocessnodechildprocess) property.
Release notes · Seen in: claude-sonnet-5-5, gemini-3.8-flash, gpt-6.1-sol · First seen 2026-11-05 · Last verified 2026-11-05 · All corrections for execa
For agents
- This page as JSON:
https://formachines.ai/errata/npm/execa/0002-subprocess-on/index.json - Whole database in plain text:
/errata/llms-full.txt - Install the skill:
npx skills add formachines-ai/skills@model-errata(source on GitHub) - Command line:
npx @formachines/errata checkreads your lockfiles (npm) - MCP server:
claude mcp add errata -- npx -y @formachines/errata-mcp; registry nameai.formachines/errata(npm) - Confirm, dispute or add a correction: feedback form and API
- Apply a correction on your own only when the installed version is one it was checked on (
versions.checked_on:versions.fails_onand every recheck) and itsproof.auto_applyis true (proof.equivalentis true andproof.applicability.statusis applies). On a newer version than those checked, a version betweenversions.works_onandversions.fails_on, or an unknown version, show it to the user as a lead and do not apply it; onversions.works_onor older it does not apply.