Repository navigation
Description
Summary
In Codex Cloud, synchronous Node.js child processes behave unexpectedly when stdio uses pipes.
Direct execution works normally, and stdio: 'inherit' also works. However, spawnSync / execFileSync with piped stdio can return EPERM, and stdout/stderr may be empty.
This causes a Next.js build to fail when Next.js invokes tsc --showConfig and attempts to capture the JSON output.
The build fails with:
Could not parse output from TypeScript's --showConfig.
Environment
- Codex Cloud
- OS: Linux
- Node.js: v24.19.0
- pnpm: 11.25.0
- Environment ID:
ccarenv_b64_Y2NhcmVudl80ZDUyY2QzZTk0MDg4MTkxODM4ZTIwNjM3ZjFlMmQ2ZQ - Reproduced at:
2026-10-03T13:32:09.880Z - Reproduced in a newly created Cloud task
Minimal reproduction
const { spawnSync } = require('node:child_process');
const r = spawnSync(
process.execPath,
['-e', 'console.log(123)'],
{
encoding: 'utf8',
stdio: 'pipe'
}
);
console.log(r);Observed result:
error.code: EPERMerror.errno: -1status: 0signal: nullstdout: ""stderr: ""
Example error:
spawnSync /opt/codex/runtimes/codex-primary-runtime/dependencies/node/bin/node EPERM
stdio comparison
stdio: 'pipe': EPERM reproducedstdio: ['pipe','pipe','pipe']: EPERM reproducedstdio: ['ignore','pipe','pipe']: no EPERM, but stdout remained empty instead of expected outputstdio: 'inherit': works normally; output is displayed correctly
/bin/echo comparison
The issue is not limited to spawning Node itself.
const { spawnSync } = require('node:child_process');
const r = spawnSync(
'/bin/echo',
['123'],
{
stdio: ['pipe','pipe','pipe'],
encoding: 'utf8'
}
);Observed:
error.code: EPERMerror.errno: -1status: 0signal: nullstdout: "123\n"stderr: ""
So EPERM can occur even when the child process successfully produces output.
Additional environment observations
- TERM: present
- CI: absent
- CODEX_* environment variables are present
- Values were not exposed
Expected behavior
Node.js synchronous child processes using piped stdio should behave normally and allow the parent process to capture stdout/stderr.
Actual behavior
Piped stdio causes EPERM and/or missing stdout/stderr, while direct execution and inherited stdio work.
This prevents Next.js from reading tsc --showConfig output and causes the build to fail.
Safety / scope
No repository code, Production environment, database, n8n workflow, Preview environment, or Secrets were modified during diagnosis. No workaround has been committed.
Activity