Windows global npm install misses optional @openai/codex-win32-x64; codex fails to start
What version of Codex CLI is running?
codex-cli 0.105.0 (installed globally via npm)
What subscription do you have?
ChatGPT Pro
Which model were you using?
N/A (startup/install issue before normal use)
What platform is your computer?
Windows (PowerShell), x64 Node.js v22.11.0 Global npm prefix/path shown as: C:\home\joelr\.npm-global
What terminal emulator and version are you using (if applicable)?
Windows PowerShell (desktop console on Windows)
What issue are you seeing?
After npm install -g @openai/codex@latest on Windows, running codex failed with:
Error: Missing optional dependency @openai/codex-win32-x64. Reinstall Codex: npm install -g @openai/codex@latest
Reinstalling did not fix it, even with optional deps enabled.
Also, trying to install @openai/codex-win32-x64@latest directly gave 404, because it appears to be an npm alias
target, not a standalone package.
What steps can reproduce the bug?
- On Windows PowerShell, uninstall globally:
npm uninstall -g @openai/codex @openai/codex-win32-x64
- Install latest:
npm install -g @openai/codex@latest --include=optional
codex --version
- Observe missing optional dependency error.
What is the expected behavior?
After npm global install on Windows, Codex should automatically include the matching platform binary optional
dependency so '' codex --version ''runs without manual alias installation.
Additional information
Working workaround was to install with explicit alias:
$v = npm view @openai/codex version
npm install -g "@openai/codex@$v" "@openai/codex-win32-x64@npm:@openai/codex@$v-win32-x64"
After workaround:
codex --version->codex-cli 0.105.0npm ls -g --depth=0 @openai/codex @openai/codex-win32-x64shows both installed.
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Closing as duplicate of #11744.
I can confirm the same Windows global npm install/startup error on codex-cli 0.105.0:
“Missing optional dependency @openai/codex-win32-x64”.
Workaround that succeeded for me:
$v = npm view @openai/codex version
npm install -g "@openai/codex@$v" "@openai/codex-win32-x64@npm:@openai/codex@$v-win32-x64"
it works!
This method itself is good, but I found that the latest 0.120.0 version shows "No matching version found for @openai/codex@0.120.0-win32-x64" when executing npm install -g "@openai/codex-win32-x64@npm:@openai/codex@0.120.0-win32-x64".
现在我不得不安装 0.119.0 这样可以正常使用
Now I have to install 0.119.0 so it can be used normally
我和你遇到了完全一样的问题,最终的解决方案也是降级。显然openai负责codex更新的员工出了些差错,最好还是等到下个更新再尝试安装吧。要不要提一个新的issue?但总感觉会被判定为重复issue。不过说起来,这么简单的问题能被重复提交这么多次,也可见维护者的疏忽大意。
I encountered exactly the same problem as you, and the final solution was also to downgrade. Apparently, there was some mistake made by the OpenAI employees responsible for Codex updates. It's probably best to wait until the next update before trying to install it again. Should we file a new issue? But I have a feeling it will be marked as a duplicate. However, considering that such a simple problem can be submitted repeatedly so many times, it shows the carelessness of the maintainers.