Error: Missing optional dependency @openai/codex-darwin-x64 on macOS 12.7.6

Open 💬 1 comment Opened Mar 11, 2026 by jhzhang09

Bug Description

After installing Codex CLI v0.114.0 via npm, running \codex\ command throws the following error:

file:///Users/[USERNAME]/.nvm/versions/node/v22.16.0/lib/node_modules/@openai/codex/bin/codex.js:100
 throw new Error(
 ^

Error: Missing optional dependency @openai/codex-darwin-x64. Reinstall Codex: npm install -g @openai/codex@latest
 at file:///Users/[USERNAME]/.nvm/versions/node/v22.16.0/lib/node_modules/@openai/codex/bin/codex.js:100:11
 at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
 at async asyncRunEntryPointWithESMLoader (node:internal/internal/modules/run_main:117:5)

Environment

  • OS: macOS 12.7.6
  • Node.js: v22.16.0
  • Codex CLI version: 0.114.0

Steps to Reproduce

  1. Install Node.js v22.16.0 via nvm
  2. Run \npm install -g @openai/codex@latest\ (installs v0.114.0)
  3. Run \codex\ command

Expected Behavior

Codex CLI should launch normally.

Additional Information

  • This issue did not occur with version 0.113.0
  • The error suggests a missing platform-specific optional dependency (@openai/codex-darwin-x64)
  • Reinstalling with \npm install -g @openai/codex@latest\ does not resolve the issue

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗