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-x64 returns 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_

View original on GitHub ↗

15 Comments

LiwojLS · 5 months ago

This is still a problem even with 0.104.0

- @openai/codex 0.99.0
+ @openai/codex 0.104.0

Done in 4.5s using pnpm v10.30.0
 BSRS  codex
file:///C:/Users/micha/AppData/Local/pnpm/global/5/.pnpm/@openai+codex@0.104.0/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/micha/AppData/Local/pnpm/global/5/.pnpm/@openai+codex@0.104.0/node_modules/@openai/codex/bin/codex.js:100:11
    at ModuleJob.run (internal/modules/esm/module_job.js:183:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5)
    at async handleMainPromise (internal/modules/run_main.js:59:12)
etraut-openai contributor · 5 months ago

Please refer to this troubleshooting documentation. Let us know if that addresses the problem you're seeing.

LiwojLS · 5 months ago

@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 · 4 months ago

having this problem too, quite annoying

ChenZ2000 · 4 months ago

Same here after update 0.104-0.105.

ChenZ2000 · 4 months ago

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 · 4 months ago

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 · 4 months ago

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 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:

npm install -g "@openai/codex-win32-x64@npm:@openai/codex@0.113.0-win32-x64"

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/codex@0.113.0-win32-x64") 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.

Yazan4m7 · 4 months ago

Confirm this worked _(after 3 days of trying)_ :

$v = npm view @openai/codex version
npm install -g "@openai/codex@$v" "@openai/codex-win32-x64@npm:@openai/codex@$v-win32-x64"
sextoncapital · 4 months ago

Confirmed that this worked for me too

-------- Original Message --------
On Sunday, 03/15/26 at 21:48 Yazan Abulaila @.***> wrote:

Yazan4m7 left a comment (openai/codex#11744) Confirm this worked (after 3 days of trying) : $v = npm view @openai/codex version npm install -g @./codex@$v" @.*@.***@./codex@$v-win32-x64" — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.*>
roryeckel · 4 months ago

The solution above https://github.com/openai/codex/issues/11744#issuecomment-4063965273 was just recommended to me by ChatGPT, and it worked!

dandan1232 · 3 months ago

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" />

wardbit · 3 months ago
## Workaround without downloading GitHub binary 无需下载 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/codex@0.113.0-win32-x64" 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/codex@0.113.0-win32-x64") 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/codex@0.113.0-win32-x64" )。注册表中并不存在 @openai/codex-win32-x64 软件包,只有 @openai/codex@{version}-win32-x64` 存在,因此 npm 返回 404 并静默地跳过它。

it's work for me

sprainJinyu · 2 months ago

<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

aspirantzhang · 1 month ago

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:

$v = npm view @openai/codex version
npm install -g "@openai/codex@$v" "@openai/codex-win32-x64@npm:@openai/codex@$v-win32-x64" --registry=https://registry.npmjs.org/

I tested it with Codex v0.134.0