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

Resolved 💬 19 comments Opened Apr 11, 2026 by ycsrc Closed Apr 26, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

On Windows x64, installing @openai/codex@0.120.0 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:

``bash
npm install -g @openai/codex
``

  1. Run:

``bash
codex
``

Actual behavior

The CLI fails to start and reports:

Missing optional dependency @openai/codex-win32-x64

Investigation

  • @openai/codex@0.120.0 installs successfully.
  • Its package.json declares the Windows optional dependency through an alias similar to:

``json
"@openai/codex-win32-x64": "npm:@openai/codex@0.120.0-win32-x64"
``

  • 0.119.0-win32-x64 exists and works.
  • 0.120.0-win32-x64 appears to be unavailable.
  • Downgrading to @openai/codex@0.119.0 restores normal behavior.

Workaround

npm install -g @openai/codex@0.119.0

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!

View original on GitHub ↗

19 Comments

github-actions[bot] contributor · 3 months ago

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

  • #17423
  • #17390

Powered by Codex Action

Lysword · 3 months ago

same problem

Xoctober · 3 months ago

same problem

Nonoas · 3 months ago

same problem

Joydevelop · 3 months ago

same problem

lhxone · 3 months ago

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

godot42x · 3 months ago

same issue, roll back to 0.119.0 works

T-T001 · 3 months ago

same problem

AntaresGG · 3 months ago

same problem

iharee · 3 months ago

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

WuSangui571 · 3 months ago

same problem

etraut-openai contributor · 3 months ago

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.

mayii2001 · 3 months ago

Cleaning the cache of npm and re-installation work.

RedoxBear · 3 months ago
Cleaning the cache of npm and re-installation work.

It doesn't... tried all morning.

Wuodan · 3 months ago
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.

Wuodan · 3 months ago

This commit would probably fix it: https://github.com/Wuodan/codex/commit/f1715ea946b3a637daaa64d9e906a64f6dc05b2b

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

PR is ready if someone invites it 😉

FelixWardUS · 2 months ago

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.

etraut-openai contributor · 2 months ago

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.

L1nq0 · 2 months ago

The same problem was investigated for a long time