npm install -g @openai/codex@latest broken on Windows after dist-tag packaging change (#11339)
Resolved 💬 15 comments Opened Feb 13, 2026 by Balaxxe Closed Apr 13, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
0.101.0
What subscription do you have?
Pro
Which model were you using?
Any
What platform is your computer?
Windows 11 Pro
What terminal emulator and version are you using (if applicable)?
PowerShell
What issue are you seeing?
Title: npm install -g @openai/codex@latest broken on Windows after dist-tag packaging change (#11339)
Key details to include:
- Worked on 0.99.x, broke on 0.100.0 and still broken on 0.101.0
@openai/codex-win32-x64returns 404 on npm registry- Error:
Missing optional dependency @openai/codex-win32-x64 - Workaround: downloading native binary from GitHub releases
- Platform: Windows x64, Node v22.15.0
What steps can reproduce the bug?
Here's what to paste in each field:
What steps can reproduce the bug?
1. On Windows x64, run: `npm install -g @openai/codex@latest`
2. Run: `codex`
Error:
Error: Missing optional dependency @openai/codex-win32-x64. Reinstall Codex: npm install -g @openai/codex@latest
3. Attempting to install the dependency directly returns 404:
npm install -g @openai/codex-win32-x64
npm error 404 Not Found - GET https://registry.npmjs.org/@openai%2fcodex-win32-x64 - Not found
The package `@openai/codex-win32-x64` does not exist on the npm registry. This regression was introduced in 0.100.0 by #11339, which switched from bundling platform binaries to distributing them via dist-tags. Previous versions (0.99.x and earlier) worked fine.
- Platform: Windows x64
- Node: v22.15.0
- Codex versions affected: 0.100.0, 0.101.0
Workaround: Download the native binary (`codex-x86_64-pc-windows-msvc.exe`) from GitHub releases and place it on PATH manually, then delete the `.ps1`, `.cmd`, and extensionless wrappers npm creates.
What is the expected behavior?
`npm install -g @openai/codex@latest` should install successfully and `codex` should launch on Windows x64 without requiring manual binary downloads, as it did in 0.99.x and earlier.
Additional information
_No response_
15 Comments
This is still a problem even with 0.104.0
Please refer to this troubleshooting documentation. Let us know if that addresses the problem you're seeing.
@etraut-openai Thanks for pointing me out. I had C++ build tools installed. However, the issue was the installation was triggered when an ancient version of Node was active on my machine (nvm). After uninstalling Codex, switching to Node 22 and installing 0.104.0 again, everything works fine now.
Thank you
having this problem too, quite annoying
Same here after update 0.104-0.105.
file:///C:/Users/sunsh/AppData/Roaming/npm/node_modules/@openai/codex/bin/codex.js:100
throw new Error(
^
Error: Missing optional dependency @openai/codex-win32-x64. Reinstall Codex: npm install -g @openai/codex@latest
at file:///C:/Users/sunsh/AppData/Roaming/npm/node_modules/@openai/codex/bin/codex.js:100:11
at ModuleJob.run (node:internal/modules/esm/module_job:413:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:654:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
Node.js v25.2.1
use this ok
$v = npm view @openai/codex version
npm install -g "@openai/codex@$v" "@openai/codex-win32-x64@npm:@openai/codex@$v-win32-x64"
Workaround without downloading GitHub binary
Found another workaround that works purely via npm (no manual binary download needed).
The issue is that npm doesn't resolve the
npm:alias inoptionalDependencieswhen doing a global install. Installing the platform-specific package explicitly using the alias syntax fixes it:Step 1: Install the main package normally:
Step 2: Manually install the Windows binary using the npm alias syntax:
Replace
0.113.0with whatever version was installed in step 1.Verification:
This works on Windows x64 with Node v24.13.0 and npm v11.10.0 (MSYS2/Git Bash).
Root cause: npm fails to install
optionalDependenciesthat usenpm:alias format (e.g."@openai/codex-win32-x64": "npm:@openai/codex@0.113.0-win32-x64") during global installs. The package@openai/codex-win32-x64literally doesn't exist on the registry — only@openai/codex@{version}-win32-x64does — so npm returns 404 and silently skips it.Confirm this worked _(after 3 days of trying)_ :
Confirmed that this worked for me too
-------- Original Message --------
On Sunday, 03/15/26 at 21:48 Yazan Abulaila @.***> wrote:
The solution above https://github.com/openai/codex/issues/11744#issuecomment-4063965273 was just recommended to me by ChatGPT, and it worked!
if you use bash/WSL,try this:
v=$(npm view @openai/codex version)
npm install -g "@openai/codex@$v" "@openai/codex-linux-x64@npm:@openai/codex@$v-linux-x64"
<img width="1098" height="341" alt="Image" src="https://github.com/user-attachments/assets/df2c4522-0faa-4b40-aba2-f511a1b7b0ce" />
it's work for me
<img width="2306" height="731" alt="Image" src="https://github.com/user-attachments/assets/cd08b329-6a39-4c1a-a4d8-51a630b30267" />
成功了,感谢:
https://github.com/openai/codex/issues/11744#issuecomment-4029550727
It's important for Chinese users to include the --registry=https://registry.npmjs.org/ argument when running the install command.
This is because we often use a custom npm source, https://registry.npmmirror.com, which may not work correctly in this case.
So the full commands would be:
I tested it with Codex v0.134.0