You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
npm install -g @openai/codex@latest broken on Windows after dist-tag packaging change (#11339) #11744
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
Reacted by Andronikos Koutroumpelis, Mikhail Nikalayeu, Ethan Song, MagnificentS, samcic, Michael Gartner, MMA, Heegon Kim, Karanjit Gill, naveline67 and 8 more
@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.
Found another workaround that works purely via npm (no manual binary download needed).
The issue is that npm doesn't resolve the npm: alias in optionalDependencies when doing a global install. Installing the platform-specific package explicitly using the alias syntax fixes it:
Step 1: Install the main package normally:
npm install -g @openai/codex
Step 2: Manually install the Windows binary using the npm alias syntax:
Replace 0.113.0 with whatever version was installed in step 1.
Verification:
$ codex --version
codex-cli 0.113.0
This works on Windows x64 with Node v24.13.0 and npm v11.10.0 (MSYS2/Git Bash).
Root cause: npm fails to install optionalDependencies that use npm: alias format (e.g. "@openai/codex-win32-x64": "npm:@openai/[email protected]") during global installs. The package @openai/codex-win32-x64 literally doesn't exist on the registry — only @openai/codex@{version}-win32-x64 does — so npm returns 404 and silently skips it.
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"
无需下载 GitHub 二进制文件的解决方法
Found another workaround that works purely via npm (no manual binary download needed).找到了另一种完全通过 npm 运行的解决方法(无需手动下载二进制文件)。
The issue is that npm doesn't resolve the npm: alias in optionalDependencies when doing a global install. Installing the platform-specific package explicitly using the alias syntax fixes it:问题在于,在进行全局安装时,npm 无法在 optionalDependencies 中解析 npm: 的别名。使用别名语法显式安装特定平台的软件包就能解决这个问题:
Step 1: Install the main package normally:步骤 1:正常安装主软件包:
npm install -g @openai/codex Step 2: Manually install the Windows binary using the npm alias syntax:第 2 步:使用 npm 别名语法手动安装 Windows 二进制文件:
npm install -g "@openai/codex-win32-x64@npm:@openai/[email protected]"
Replace 0.113.0 with whatever version was installed in step 1.将 0.113.0 替换为步骤 1 中安装的版本。
Verification: 验证:
$ codex --version
codex-cli 0.113.0
This works on Windows x64 with Node v24.13.0 and npm v11.10.0 (MSYS2/Git Bash).该功能可在 Windows x64 上使用 Node v24.13.0 和 npm v11.10.0 (MSYS2/Git Bash) 运行。
Root cause: npm fails to install optionalDependencies that use npm: alias format (e.g. "@openai/codex-win32-x64": "npm:@openai/[email protected]") during global installs. The package @openai/codex-win32-x64 literally doesn't exist on the registry — only @openai/codex@{version}-win32-x64 does — so npm returns 404 and silently skips it.根本原因:在全局安装过程中,npm 无法安装使用 npm: 别名格式的 optionalDependencies (例如 "@openai/codex-win32-x64": "npm:@openai/[email protected]" )。注册表中并不存在 @openai/codex-win32-x64 软件包,只有 @openai/codex@{version}-win32-x64 存在,因此 npm 返回 404 并静默地跳过它。
it's work for me
Activity
LiwojLS commentedon Feb 19, 2026
This is still a problem even with 0.104.0
etraut-openai commentedon Feb 19, 2026
Please refer to this troubleshooting documentation. Let us know if that addresses the problem you're seeing.
LiwojLS commentedon Feb 20, 2026
@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
sextoncapital commentedon Feb 26, 2026
having this problem too, quite annoying
ChenZ2000 commentedon Feb 26, 2026
Same here after update 0.104-0.105.
ChenZ2000 commentedon Feb 26, 2026
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
ipfred commentedon Mar 6, 2026
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"
bruce0817kr commentedon Mar 10, 2026
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:
npm install -g "@openai/codex-win32-x64@npm:@openai/[email protected]"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/[email protected]") 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.Yazan4m7 commentedon Mar 15, 2026
Confirm this worked (after 3 days of trying) :
sextoncapital commentedon Mar 15, 2026
roryeckel commentedon Mar 19, 2026
The solution above #11744 (comment) was just recommended to me by ChatGPT, and it worked!
dandan1232 commentedon Mar 30, 2026
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"
wardbit commentedon Apr 3, 2026
sprainJinyu commentedon May 17, 2026
成功了,感谢:
#11744 (comment)
aspirantzhang commentedon May 27, 2026
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