Bug: codex fails with "Missing optional dependency @openai/codex-linux-x64" on Ubuntu x86_64
Open 💬 12 comments Opened Mar 5, 2026 by tsugumi-sys
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
0.110.0
What subscription do you have?
Plus
Which model were you using?
_No response_
What platform is your computer?
_No response_
What terminal emulator and version are you using (if applicable)?
_No response_
What issue are you seeing?
Running codex fails with:
Error: Missing optional dependency @openai/codex-linux-x64.
Reinstall Codex: npm install -g @openai/codex@latest
Environment:
- OS: Ubuntu 22.04.4 LTS
- Kernel: 5.15.0-157-generic
- Architecture: x86_64
- Node: v24.14.0
- npm: 11.9.0
- Codex CLI: 0.110.0
What steps can reproduce the bug?
node -v
# v24.14.0
npm -v
# 11.9.0
sudo npm install -g @openai/codex@latest
which codex
# /usr/local/bin/codex
codex --version
What is the expected behavior?
_No response_
Additional information
_No response_
12 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Downgrading Node resolved the issue.
The problem occurred with the following environment:
Running
codexresulted in:Error: Missing optional dependency @openai/codex-linux-x64
As a workaround, I downgraded Node using
nvm:nvm install 22
nvm use 22
npm install -g @openai/codex@latest
After switching to:
codexworks correctly.This may indicate a compatibility issue with Node 24 / npm 11 and optional dependency resolution.
I've confirmed this was introduced in this PR.
Hmm, so if you go to https://www.npmjs.com/package/@openai/codex?activeTab=code and look at
package.json, you should see:Based on the report of
OS: Ubuntu 22.04.4 LTS (x86_64), this should installcodex@0.110.0-linux-x64, which certainly seems to exist:https://www.npmjs.com/package/@openai/codex/v/0.110.0-linux-x64
And if you look at the
package.jsonfor that specific tag, you see:so those
osandcpuentries are what should enablenpmto figure out that it is the appropriate optional dependency to install for the host machine.Perhaps these tags/values changed in
npm11? If so, this seems like a bug/regression innpm.npm install -g @openai/codex@0.111.0 "@openai/codex-linux-x64@npm:@openai/codex@0.111.0-linux-x64" && codex -vwill work for Ubuntu users
ChatGPT found some related issues regarding
osandcpuinformation being pruned:And then https://github.com/npm/cli/issues/8535 claims
npm >= 11.10.1fixes things?@bolinfest I've tested with npm@11.11.0 but the issue is the same.
Tested with npm@10.9.2 , the problem still exist
Tested with npm@11.11.0 , the problem solved.
I can confirm that the workaround for Ubuntu users also works for Debian on WSL2 (Windows 11), but with a critical caveat for WSL users regarding environment isolation.
Initially, the forced dependency command failed for me because my WSL terminal was defaulting to the Windows-installed version of Node/npm (located in /mnt/c/Users/...), which was causing a cross-platform binary mismatch when trying to resolve @openai/codex-linux-x64.
The fix for WSL users:
npm install -g @openai/codex@0.111.0 "@openai/codex-linux-x64@npm:@openai/codex@0.111.0-linux-x64"
Once I was running a strictly native Linux Node environment, the @0.111.0 forced dependency resolved the "Missing optional dependency" error perfectly on Debian. Thanks for this thread, hope it helps someone else.
this works thanks
hi, look this command
npm install -g @openai/codex@0.124.0 "@openai/codex-linux-x64@npm:@openai/codex@0.124.0-linux-x64" --registry=https://registry.npmjs.org/