Skip to content

Bug: codex fails with "Missing optional dependency @openai/codex-linux-x64" on Ubuntu x86_64 #13555

Open

Description

@tsugumi-sys

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

Activity

  1. added
    bug
    on Mar 5, 2026
  2. added
    CLI
    on Mar 5, 2026
  3. github-actions commented on Mar 5, 2026

    @github-actions
    Contributor
  4. tsugumi-sys commented on Mar 5, 2026

    @tsugumi-sys
    Author

    Downgrading Node resolved the issue.

    The problem occurred with the following environment:

    • Node: v24.14.0
    • npm: 11.9.0
    • Codex CLI: 0.110.0
    • OS: Ubuntu 22.04.4 LTS (x86_64)

    Running codex resulted 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:

    • Node: v22.22.0
    • npm: 10.9.4

    codex works correctly.

    This may indicate a compatibility issue with Node 24 / npm 11 and optional dependency resolution.

  5. etraut-openai commented on Mar 5, 2026

    @etraut-openai
    Contributor

    I've confirmed this was introduced in this PR.

  6. added
    regression
    on Mar 5, 2026
  7. bolinfest commented on Mar 5, 2026

    @bolinfest
    Collaborator

    Hmm, so if you go to https://www.npmjs.com/package/@openai/codex?activeTab=code and look at package.json, you should see:

      "optionalDependencies": {
        "@openai/codex-linux-x64": "npm:@openai/[email protected]",
        "@openai/codex-linux-arm64": "npm:@openai/[email protected]",
        "@openai/codex-darwin-x64": "npm:@openai/[email protected]",
        "@openai/codex-darwin-arm64": "npm:@openai/[email protected]",
        "@openai/codex-win32-x64": "npm:@openai/[email protected]",
        "@openai/codex-win32-arm64": "npm:@openai/[email protected]"
      }

    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.json for that specific tag, you see:

    {
      "name": "@openai/codex",
      "version": "0.110.0-linux-x64",
      "license": "Apache-2.0",
      "os": [
        "linux"
      ],
      "cpu": [
        "x64"
      ],

    so those os and cpu entries are what should enable npm to figure out that it is the appropriate optional dependency to install for the host machine.

    Perhaps these tags/values changed in npm 11? If so, this seems like a bug/regression in npm.

  8. cbirdliu commented on Mar 6, 2026

    @cbirdliu

    npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]" && codex -v
    will work for Ubuntu users

  9. bolinfest commented on Mar 6, 2026

    @bolinfest
    Collaborator
  10. tsugumi-sys commented on Mar 6, 2026

    @tsugumi-sys
    Author

    @bolinfest I've tested with [email protected] but the issue is the same.

  11. Marcus112-CS commented on Mar 7, 2026

    @Marcus112-CS

    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

  12. lamb007 commented on Mar 7, 2026

    @lamb007

    npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]" && codex -v will work for Ubuntu users

    Tested with [email protected] , the problem solved.

  13. anthony-maio commented on Mar 16, 2026

    @anthony-maio

    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:

    1. Isolate the environment: Install a native Linux version of Node inside WSL using nvm to ensure you aren't bridging to the Windows npm folders: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
    2. Clear the npm prefix: Run npm config delete prefix to ensure global installs stay within the Linux file system.
    3. Apply the Ubuntu workaround:
      npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]"
    4. 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.

  14. CoderYellow commented on Apr 24, 2026

    @CoderYellow

    npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]"

    this works thanks

  15. mengdodo commented on Apr 24, 2026

    @mengdodo

    hi, look this command
    npm install -g @openai/[email protected] "@openai/codex-linux-x64@npm:@openai/[email protected]" --registry=https://registry.npmjs.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIbugregression

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions