Skip to content

Windows: npm install -g @openai/codex installs 0.120.0 but CLI fails with missing @openai/codex-win32-x64 #17432

Closed

Description

@ycsrc

Summary

On Windows x64, installing @openai/[email protected] globally via npm succeeds, but running codex fails immediately with:

Missing optional dependency @openai/codex-win32-x64

After checking the package metadata and available versions, it looks like the main package 0.120.0 was published, but the Windows platform package version it depends on (0.120.0-win32-x64) is missing / not available.

Environment

  • OS: Windows 10 x64
  • Node.js: v24.14.0
  • npm: 11.6.2
  • Architecture: AMD64

Reproduction

  1. Run:
    npm install -g @openai/codex
  2. Run:
    codex

Actual behavior

The CLI fails to start and reports:

Missing optional dependency @openai/codex-win32-x64

Investigation

  • @openai/[email protected] installs successfully.
  • Its package.json declares the Windows optional dependency through an alias similar to:
    "@openai/codex-win32-x64": "npm:@openai/[email protected]"
  • 0.119.0-win32-x64 exists and works.
  • 0.120.0-win32-x64 appears to be unavailable.
  • Downgrading to @openai/[email protected] restores normal behavior.

Workaround

npm install -g @openai/[email protected]

Then:

codex --version

returns:

codex-cli 0.119.0

Expected behavior

Installing @openai/codex@latest on Windows should install a matching Windows platform package so that codex starts successfully.

Thanks!

Activity

  1. added
    bug
    CLI
    windows-os
    on Apr 11, 2026
  2. github-actions commented on Apr 11, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. Lysword commented on Apr 11, 2026

    @Lysword

    same problem

  4. Xoctober commented on Apr 11, 2026

    @Xoctober

    same problem

  5. Nonoas commented on Apr 11, 2026

    @Nonoas

    same problem

  6. Joydevelop commented on Apr 11, 2026

    @Joydevelop

    same problem

  7. lhxone commented on Apr 11, 2026

    @lhxone

    Same, I roll back to old version with Codex Desktop APP😅

  8. godot42x commented on Apr 11, 2026

    @godot42x

    same issue, roll back to 0.119.0 works

  9. T-T001 commented on Apr 11, 2026

    @T-T001

    same problem

  10. AntaresGG commented on Apr 11, 2026

    @AntaresGG

    same problem

  11. iharee commented on Apr 11, 2026

    @iharee

    Same problem. Rolling back to version 0.119.0 can avoid this issue, temporarily​:
    npm uninstall -g @openai/codex; npm install -g @openai/[email protected]

  12. WuSangui571 commented on Apr 11, 2026

    @WuSangui571

    same problem

  13. etraut-openai commented on Apr 12, 2026

    @etraut-openai
    Contributor

    We think this may have been caused by the fact that it took a while to upload all of the bundles to npm, and the win32-x64 bundle was the last one that was uploaded. If you hit this problem, try to uninstall and reinstall again now that all the bundles have been uploaded. Let us know if that fixes the problem.

  14. mayii2001 commented on Apr 13, 2026

    @mayii2001

    Cleaning the cache of npm and re-installation work.

  15. RedoxBear commented on Apr 14, 2026

    @RedoxBear

    Cleaning the cache of npm and re-installation work.

    It doesn't... tried all morning.

  16. Wuodan commented on Apr 20, 2026

    @Wuodan

    We think this may have been caused by the fact that it took a while to upload all of the bundles to npm, and the win32-x64 bundle was the last one that was uploaded. If you hit this problem, try to uninstall and reinstall again now that all the bundles have been uploaded. Let us know if that fixes the problem.

    I also suspect the order by which bundles are uploaded to npm to be the issue as I just today had the same issue with codex 0.122.0.

    I have a scheduler which checks if a new version is available (10 min interval) and if so builds a Docker image with it. Worked fine for several months now.

    But with the image for codex 0.122.0 built today, I had this error:

    file:///usr/local/lib/node_modules/@openai/codex/bin/codex.js:100
        throw new Error(
              ^
    
    Error: Missing optional dependency @openai/codex-linux-x64. Reinstall Codex: npm install -g @openai/codex@latest
        at file:///usr/local/lib/node_modules/@openai/codex/bin/codex.js:100:11
        at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
        at async node:internal/modules/esm/loader:639:26
        at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
    
    Node.js v24.15.0
    

    and then running npm install -g @openai/codex in the container fixes the issue.

    So to me this looks like my scheduler found a new version of codex whgen that was uploaded to npm, but at that time the bundle for @openai/codex-linux-x64 was not yet uploaded to npm. Thus my image was built without @openai/codex-linux-x64.

    The clean fix might just be to on-release upload the new codex bundle last and not before dependencies.

  17. Wuodan commented on Apr 20, 2026

    @Wuodan

    This commit would probably fix it: Wuodan@f1715ea

    It just makes sure that the tarball dist/npm/codex-npm-{version}.tg is published last.

    PR is ready if someone invites it 😉

  18. FelixWardUS commented on Apr 26, 2026

    @FelixWardUS

    This is exactly the kind of case I had in mind when I made a small pre-check tool:

    https://github.com/FelixWardUS/codex-npm-check

    It checks the main Codex npm package and the selected platform packages before install, including whether their tarballs are reachable.

    npm install -g codex-npm-check
    cnc

    For scripted upgrades or scheduled builds, this can help catch a half-published npm release before the install/image build grabs it. It only catches npm publishing/registry problems, not runtime bugs after install.

  19. etraut-openai commented on Apr 26, 2026

    @etraut-openai
    Contributor

    This will be fixed in the next release, thanks to this PR. Actually, it will be completely fixed one release after next because part of the fix is in the client code. The next CLI release will include the fix so it can avoid this problem on the following update.

  20. L1nq0 commented on Apr 30, 2026

    @L1nq0

    The same problem was investigated for a long time

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

    CLIbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions