codex CLI crashes in Node.js 20+ due to read-only process.noDeprecation assignment

Resolved 💬 3 comments Opened Apr 18, 2025 by Hitman247m Closed Apr 18, 2025

What version of Codex is running?

0.1.2504172351

Which model were you using?

N/A

What platform is your computer?

Darwin 24.4.0 arm64 arm

What steps can reproduce the bug?

Environment:

  • Node.js: v22.14.0 (LTS)
  • OS: macOS (Apple Silicon)
  • Codex CLI: latest (installed globally via npm)
  • Location: /opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js

Issue:

Running any codex command fails with:

$ codex --version
file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:675
`;let s=E=>{console.log(a),h7.exit(typeof E=="number"?E:2)},c=()=>{console.log(typeof e.version=="string"?e.version:r.version),h7.exit(0)};n._.length===0&&e.argv.length===1&&(n.version===!0&&e.autoVersion?c():n.help===!0&&e.autoHelp&&s(0));let d=n._;delete n._,e.allowUnknownFlags||uce(d);let f=dle(n,{exclude:["--",/^\w$/]}),A={...f};cce(f,e);for(let E of Object.values(e.flags)){if(Array.isArray(E.aliases))for(let C of E.aliases)delete f[C];delete f[E.shortFlag]}return dce(e.flags,f,d),{input:d,flags:f,unnormalizedFlags:A,pkg:r,help:a,showHelp:s,showVersion:c}},pce=(e,t={})=>{let r=oce(e,t),n=sce(r),a=CFe(r,n);return h7.title=a.pkg.bin?Object.keys(a.pkg.bin).at(0):a.pkg.name,a};var fce=Le(st(),1);import E7 from"path";process.noDeprecation=!0;Kb();var qa=pce(`
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^

TypeError: Cannot assign to read only property 'noDeprecation' of object '#<process>'
    at file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:675:748

Node.js v22.14.0

What is the expected behavior?

_No response_

What do you see instead?

$ codex --version
file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:675
`;let s=E=>{console.log(a),h7.exit(typeof E=="number"?E:2)},c=()=>{console.log(typeof e.version=="string"?e.version:r.version),h7.exit(0)};n._.length===0&&e.argv.length===1&&(n.version===!0&&e.autoVersion?c():n.help===!0&&e.autoHelp&&s(0));let d=n._;delete n._,e.allowUnknownFlags||uce(d);let f=dle(n,{exclude:["--",/^\w$/]}),A={...f};cce(f,e);for(let E of Object.values(e.flags)){if(Array.isArray(E.aliases))for(let C of E.aliases)delete f[C];delete f[E.shortFlag]}return dce(e.flags,f,d),{input:d,flags:f,unnormalizedFlags:A,pkg:r,help:a,showHelp:s,showVersion:c}},pce=(e,t={})=>{let r=oce(e,t),n=sce(r),a=CFe(r,n);return h7.title=a.pkg.bin?Object.keys(a.pkg.bin).at(0):a.pkg.name,a};var fce=Le(st(),1);import E7 from"path";process.noDeprecation=!0;Kb();var qa=pce(`
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^

TypeError: Cannot assign to read only property 'noDeprecation' of object '#<process>'
    at file:///opt/homebrew/lib/node_modules/@openai/codex/dist/cli.js:675:748

Node.js v22.14.0

Additional information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗