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
- Run:
``bash``
npm install -g @openai/codex
- Run:
``bash``
codex
Actual behavior
The CLI fails to start and reports:
Missing optional dependency @openai/codex-win32-x64
Investigation
@openai/codex@0.120.0installs successfully.- Its
package.jsondeclares 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-x64exists and works.0.120.0-win32-x64appears to be unavailable.- Downgrading to
@openai/codex@0.119.0restores 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!
19 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
same problem
same problem
same problem
same problem
Same, I roll back to old version with Codex Desktop APP😅
same issue, roll back to 0.119.0 works
same problem
same problem
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.0same problem
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.
Cleaning the cache of npm and re-installation work.
It doesn't... tried all morning.
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.0built today, I had this error:and then running
npm install -g @openai/codexin the container fixes the issue.So to me this looks like my scheduler found a new version of
codexwhgen that was uploaded to npm, but at that time the bundle for@openai/codex-linux-x64was 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
codexbundle last and not before dependencies.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}.tgis published last.PR is ready if someone invites it 😉
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.
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.
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.
The same problem was investigated for a long time