Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.

Open 💬 28 comments Opened May 13, 2026 by Adaozuishuai

What version of the Codex App are you using (From “About Codex” dialog)?

Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.

What subscription do you have?

我在设置中codex app中设置了wsl可以运行 然后app打不开,一直显示出错了,重新加载也没有用

What platform is your computer?

_No response_

What issue are you seeing?

Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex. 可以尝试的3个解决方案都没有效果

What steps can reproduce the bug?

我的codex cli 是配置在wsl 2中的 ,然后我下载codex app在设置里面打开了wsl启动这个选项就出现了这个报错。

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

28 Comments

vcerfe · 2 months ago

the same issue I encounter

benname · 2 months ago

the same issue I encounter

1ceS1amese · 2 months ago

备份并重置一下codex的设置即可

benname · 2 months ago
备份并重置一下codex的设置即可

Only way to make it work was to edit .codex-global-state.json and set runCodexInWindowsSubsystemForLinux to false

1ceS1amese · 2 months ago

是的

曙光
@.***

thanh125643 · 2 months ago

i think this dup to this issues #22672

Zhangchunqin · 2 months ago

me too

Adaozuishuai · 2 months ago
备份并重置一下codex的设置即可

好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错

Adaozuishuai · 2 months ago

然后现在这个app bug界面我点击重新加载,会闪出1秒左右的登录界面,然后我根据指引配置CODEX_CLI_PATH在config文件中依旧如出现此bug 我通过 which codex拿到的路径如下‘/home/wangguangyi/.local/bin/codex’,我 CODEX_CLI_PATH配置就是前面我获取的路径

QwQ-is-not-available · 1 month ago
> 备份并重置一下codex的设置即可 好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错

same
同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘

如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉

runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"

之后就能重新打开app了

JunieXD · 1 month ago
> > 备份并重置一下codex的设置即可 > > > 好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错 same 同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘 如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉 `` runCodexInWindowsSubsystemForLinux = true integratedTerminalShell = "wsl" `` 之后就能重新打开app了

打开是能打开了,但又给切回去了,这样改本来是想用wsl的codex,目的没达到啊,都一个月了怎么还没人找到解决方案

thosehow · 1 month ago

the same issue I encounter

QwQ-is-not-available · 1 month ago
> > > 备份并重置一下codex的设置即可 > > > > > > 好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错 > > > same 同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘 > 如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉 > `` > runCodexInWindowsSubsystemForLinux = true > integratedTerminalShell = "wsl" > `` > > > > > > > > > > > > 之后就能重新打开app了 打开是能打开了,但又给切回去了,这样改本来是想用wsl的codex,目的没达到啊,都一个月了怎么还没人找到解决方案

记得另外一个issue里提到说把codex app安装位置调整回c盘就正常了;我是直接在wsl2里用codex cli了,感觉还行

JunieXD · 1 month ago
> > > > 备份并重置一下codex的设置即可 > > > > > > > > > 好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错 > > > > > > same 同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘 > > 如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉 > > `` > > runCodexInWindowsSubsystemForLinux = true > > integratedTerminalShell = "wsl" > > `` > > > > > > > > > > > > > > > > > > > > > > > > 之后就能重新打开app了 > > > 打开是能打开了,但又给切回去了,这样改本来是想用wsl的codex,目的没达到啊,都一个月了怎么还没人找到解决方案 记得另外一个issue里提到说把codex app安装位置调整回c盘就正常了;我是直接在wsl2里用codex cli了,感觉还行

codex app安装位置本来就在c盘吧,没招了

QwQ-is-not-available · 1 month ago
> > > > > 备份并重置一下codex的设置即可 > > > > > > > > > > > > 好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错 > > > > > > > > > same 同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘 > > > 如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉 > > > `` > > > runCodexInWindowsSubsystemForLinux = true > > > integratedTerminalShell = "wsl" > > > `` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 之后就能重新打开app了 > > > > > > 打开是能打开了,但又给切回去了,这样改本来是想用wsl的codex,目的没达到啊,都一个月了怎么还没人找到解决方案 > > > 记得另外一个issue里提到说把codex app安装位置调整回c盘就正常了;我是直接在wsl2里用codex cli了,感觉还行 codex app安装位置本来就在c盘吧,没招了

要是从微软商店安装的话安装位置可以自定义的,对于win11在系统的 设置,系统,存储,高级存储设置,保存新内容的地方,新的应用将保存到,这个设置项,如果本来就是c盘的话那我就不知道了,我就设置的是d盘

BretJohnson · 1 month ago
> 备份并重置一下codex的设置即可 Only way to make it work was to edit .codex-global-state.json and set runCodexInWindowsSubsystemForLinux to false

Same for me, but note that this setting was in .codex/config.toml not .codex-global-state.json

hit-ws · 1 month ago

我也遇到了同样的问题。今天 Codex App 更新到 26.609.4994.0 后,原本正常使用的 WSL 模式无法启动。

I have the same issue. After updating Codex App to 26.609.4994.0 today, the app fails to start in WSL mode.

Environment / 环境:

Windows 11
Codex App: OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0
WSL: Ubuntu, version 2
Agent environment: WSL
Integrated terminal: WSL

Error / 报错:

Unable to locate the Codex CLI binary.
Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.

Diagnostics / 诊断结果:

From PowerShell:

wsl -e bash -c 'command -v codex || echo NOT_FOUND'

Output:

NOT_FOUND

But login shell can find Codex:

wsl -e bash -lc 'command -v codex; codex --version; command -v bwrap'

Output:

/home/hit_ws/.nvm/versions/node/v24.14.0/bin/codex
codex-cli 0.139.0
/usr/bin/bwrap

So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update.

Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error.

中文补充:更新前 WSL 模式一直正常,更新后立刻报错。看起来像是 Codex App 26.609 对 WSL CLI discovery 的启动方式变了,导致非登录 shell 找不到 NVM 里的 codex。

BretJohnson · 1 month ago
我也遇到了同样的问题。今天 Codex App 更新到 26.609.4994.0 后,原本正常使用的 WSL 模式无法启动。 I have the same issue. After updating Codex App to 26.609.4994.0 today, the app fails to start in WSL mode. Environment / 环境: `` Windows 11 Codex App: OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0 WSL: Ubuntu, version 2 Agent environment: WSL Integrated terminal: WSL ` **Error / 报错:** ` Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex. ` **Diagnostics / 诊断结果:** From PowerShell: wsl -e bash -c 'command -v codex || echo NOT_FOUND' Output: ` NOT_FOUND ` But login shell can find Codex: wsl -e bash -lc 'command -v codex; codex --version; command -v bwrap' Output: ` /home/hit_ws/.nvm/versions/node/v24.14.0/bin/codex codex-cli 0.139.0 /usr/bin/bwrap `` So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update. Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error. 中文补充:更新前 WSL 模式一直正常,更新后立刻报错。看起来像是 Codex App 26.609 对 WSL CLI discovery 的启动方式变了,导致非登录 shell 找不到 NVM 里的 codex。

I see the same thing: after updating to 26.609.41114 today, the app fails to start in WSL mode, where it was working before. Setting runCodexInWindowsSubsystemForLinux to false in .codex/config.toml allows it to start - non WSL - but that's not a workaround as I need to use WSL.

Bagel-Badge · 1 month ago
> 我也遇到了同样的问题。今天 Codex App 更新到 26.609.4994.0 后,原本正常使用的 WSL 模式无法启动。 > > I have the same issue. After updating Codex App to 26.609.4994.0 today, the app fails to start in WSL mode.我遇到了相同的问题。今天将 Codex App 更新到 26.609.4994.0 后,该应用在 WSL 模式下无法启动。 > > Environment / 环境:Environment / 环境: > > `` > Windows 11 > Codex App: OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0 > WSL: Ubuntu, version 2 > Agent environment: WSL > Integrated terminal: WSL > ` > > > > > > > > > > > > > **Error / 报错:** > > ` > Unable to locate the Codex CLI binary. > Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex. > ` > > > > > > > > > > > > > **Diagnostics / 诊断结果:** > > From PowerShell:From PowerShell: > > wsl -e bash -c 'command -v codex || echo NOT_FOUND'wsl -e bash -c 'command -v codex || echo NOT_FOUND' > Output: > Output: > > ` > NOT_FOUND > ` > > > > > > > > > > > > > But login shell can find Codex:But login shell can find Codex: > > wsl -e bash -lc 'command -v codex; codex --version; command -v bwrap'wsl -e bash -lc 'command -v codex; codex --version; command -v bwrap' > Output: > Output: > > ` > /home/hit_ws/.nvm/versions/node/v24.14.0/bin/codex > codex-cli 0.139.0 > /usr/bin/bwrap > ` > > > > > > > > > > > > > So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update.因此,Codex CLI 在 WSL 登录 shell 中可以正常工作,但更新后 Windows 版 Codex App 无法发现它。 > > Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error.在此次更新之前,相同的 WSL 设置可以正常运行。今天点击应用内更新提示后,应用立即开始出现此错误。 > > 中文补充:更新前 WSL 模式一直正常,更新后立刻报错。看起来像是 Codex App 26.609 对 WSL CLI discovery 的启动方式变了,导致非登录 shell 找不到 NVM 里的 codex。 I see the same thing: after updating to 26.609.41114 today, the app fails to start in WSL mode, where it was working before. Setting runCodexInWindowsSubsystemForLinux to false in .codex/config.toml allows it to start - non WSL - but that's not a workaround as I need to use WSL.我观察到了相同的情况:今天更新到 26.609.41114 后,该应用在之前可以正常工作的 WSL 模式下无法启动。将 .codex/config.toml 中的 runCodexInWindowsSubsystemForLinux` 设置为 false 可以使其以非 WSL 模式启动,但这并非一种变通方案,因为我需要使用 WSL。

I also encountered the same problem after the update.
我在更新后也遇到了相同的问题。

临时解决方法:回退 Codex App 至 2026年6月13日 之前的版本,如26.608.12217,这个仓库里面有桌面版安装包的镜像 codex-app-mirror
Temporary workaround: Roll back the Codex App to a version prior to June 13, 2026, such as 26.608.12217. You can find mirrors for the desktop installers in this repository: codex-app-mirror.

cls1277 · 1 month ago
我也遇到了同样的问题。今天 Codex App 更新到 26.609.4994.0 后,原本正常使用的 WSL 模式无法启动。 I have the same issue. After updating Codex App to 26.609.4994.0 today, the app fails to start in WSL mode. Environment / 环境: `` Windows 11 Codex App: OpenAI.Codex_26.609.4994.0_x64__2p2nqsd0c76g0 WSL: Ubuntu, version 2 Agent environment: WSL Integrated terminal: WSL ` **Error / 报错:** ` Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex. ` **Diagnostics / 诊断结果:** From PowerShell: wsl -e bash -c 'command -v codex || echo NOT_FOUND' Output: ` NOT_FOUND ` But login shell can find Codex: wsl -e bash -lc 'command -v codex; codex --version; command -v bwrap' Output: ` /home/hit_ws/.nvm/versions/node/v24.14.0/bin/codex codex-cli 0.139.0 /usr/bin/bwrap `` So the Codex CLI works in WSL login shell, but the Windows Codex App cannot discover it after the update. Before this update, the same WSL setup worked normally. After clicking the in-app update prompt today, the app immediately started failing with this error. 中文补充:更新前 WSL 模式一直正常,更新后立刻报错。看起来像是 Codex App 26.609 对 WSL CLI discovery 的启动方式变了,导致非登录 shell 找不到 NVM 里的 codex。

me too !

cls1277 · 1 month ago
xuetianhao98 · 1 month ago

Environment

  • Windows 11 with WSL2
  • The Codex workspace is located inside WSL2

Issue and Solution

I encountered the same issue: after Codex was updated, it failed to launch the next time I opened it.

The solution that worked for me was to set the following environment variable in Windows:

CODEX_CLI_PATH=C:\Users\<YOUR_USERNAME>\.codex\bin\wsl\<VERSION_OR_HASH>\codex

After configuring this environment variable, Codex has been working normally.

Important Note

There may be a similar Codex installation under:

C:\Users\<YOUR_USERNAME>\AppData\Local\OpenAI\Codex

However, if your workspace and development environment are running inside WSL, do not use the executable from that directory. Use the WSL-specific Codex executable located under your .codex\bin\wsl directory instead.

BretJohnson · 1 month ago

For me, I didn't have a C:\Users\<YOUR_USERNAME>\.codex\bin\wsl directory (perhaps I used to but I had deleted contents of .codex and apparently the latest Codex app install on Windows doesn't install this).

So I ended up going with this workaround: https://github.com/openai/codex/issues/22672#issuecomment-4697826414

black-yt · 1 month ago

更新 Codex App 后出现:

Unable to locate the Codex CLI binary

如果之前在 Codex App 里把 Agent Environment 设置成了 WSL,那么实际上系统里可能同时存在 3 个 Codex:

  1. Windows npm 安装的 Codex
C:\Users\<user>\AppData\Roaming\npm\codex
C:\Users\<user>\AppData\Roaming\npm\codex.cmd

这是在 Windows 终端里执行 codex 用的。

  1. WSL 里自己安装的 Codex

例如:

/home/xwh/.nvm/versions/node/v22.22.2/bin/codex

这是你在 Ubuntu/WSL 终端里执行 codex 用的。

  1. Codex App 自动生成的 WSL Wrapper(真正被 App 调用的)

例如:

C:\Users\<user>\.codex\bin\wsl\48731301ce01af57\codex

这是 Codex App 为了桥接 Windows 和 WSL 自动生成的启动器。

问题的根源在于:

  • 更新前,Codex App 被设置为使用 WSL 环境。
  • 很多人以为它直接调用第 2 个(WSL 里的 codex)。
  • 实际上它调用的是第 3 个(自己生成的 WSL Wrapper)。
  • 更新后 App 丢失了这个 Wrapper 的定位信息。
  • 因此启动时报:
Unable to locate the Codex CLI binary

很多人会误把环境变量设置到:

AppData\Roaming\npm\codex

或者:

/home/.../codex

结果会出现各种奇怪错误(.cmd 语法错误、node not found 等)。

正确修复方法:

先找到 App 自动生成的 WSL Wrapper,找到类似:

C:\Users\<user>\.codex\bin\wsl\48731301ce01af57\codex

然后设置:

setx CODEX_CLI_PATH "C:\Users\<user>\.codex\bin\wsl\48731301ce01af57\codex"

验证:

echo %CODEX_CLI_PATH%

重启 Codex App 即可恢复。

thxzrp · 1 month ago

tive o mesmo problema após atualizar ontem. solução foi setar as variáveis de ambiente de volta ao windows.

bugstan · 1 month ago

same
Thank you @black-yt

LvJohny · 1 month ago
> > > 备份并重置一下codex的设置即可 > > > > > > 好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错 > > > same 同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘 > 如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉 > `` > runCodexInWindowsSubsystemForLinux = true > integratedTerminalShell = "wsl" > `` > > > > > > > > > > > > 之后就能重新打开app了 打开是能打开了,但又给切回去了,这样改本来是想用wsl的codex,目的没达到啊,都一个月了怎么还没人找到解决方案

修改回去
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"

Buzzology · 1 month ago

Same problem