You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: codex fails with "Missing optional dependency @openai/codex-linux-x64" on Ubuntu x86_64 #13555
npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]" && codex -v will work for Ubuntu users适用于 Ubuntu 用户
Tested with [email protected] , the problem still exist
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.
Refresh the path: Run hash -r so the terminal points to the new Linux binary instead of the cached Windows path.
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.
Reacted by cj, Morobara, Aspirant Zhang, christdb87, Hydrochloride07 and Martin Ambrus
Activity
github-actions commentedon Mar 5, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
tsugumi-sys commentedon Mar 5, 2026
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.
etraut-openai commentedon Mar 5, 2026
I've confirmed this was introduced in this PR.
bolinfest commentedon Mar 5, 2026
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 install[email protected], 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:{ "name": "@openai/codex", "version": "0.110.0-linux-x64", "license": "Apache-2.0", "os": [ "linux" ], "cpu": [ "x64" ],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.cbirdliu commentedon Mar 6, 2026
npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]" && codex -vwill work for Ubuntu users
bolinfest commentedon Mar 6, 2026
ChatGPT found some related issues regarding
osandcpuinformation being pruned:And then npm/cli#8535 claims
npm >= 11.10.1fixes things?tsugumi-sys commentedon Mar 6, 2026
@bolinfest I've tested with [email protected] but the issue is the same.
Marcus112-CS commentedon Mar 7, 2026
lamb007 commentedon Mar 7, 2026
Tested with [email protected] , the problem solved.
anthony-maio commentedon Mar 16, 2026
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/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]"
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.
Add Codex agent adapter
Add Codex agent adapter
CoderYellow commentedon Apr 24, 2026
this works thanks
mengdodo commentedon Apr 24, 2026
hi, look this command
npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]" --registry=https://registry.npmjs.org/Add Codex agent adapter
Add Codex agent adapter