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_
28 Comments
the same issue I encounter
the same issue I encounter
备份并重置一下codex的设置即可
Only way to make it work was to edit .codex-global-state.json and set runCodexInWindowsSubsystemForLinux to false
是的
曙光
@.***
i think this dup to this issues #22672
me too
好像还是不行我直接给config文件删除了,codex走默认的设置了,打开依旧是这个Unable to locate the Codex CLI binary. Set CODEX_CLI_PATH or ensure the Electron resources include bin/codex.报错
然后现在这个app bug界面我点击重新加载,会闪出1秒左右的登录界面,然后我根据指引配置CODEX_CLI_PATH在config文件中依旧如出现此bug 我通过 which codex拿到的路径如下‘/home/wangguangyi/.local/bin/codex’,我 CODEX_CLI_PATH配置就是前面我获取的路径
same
同样情况,app里智能体环境改为wsl之后打不开app,app没装在c盘
如果说是需要要能重新打开app页面的话,我是在c盘用户目录里的.codex/config.toml 里删掉
之后就能重新打开app了
打开是能打开了,但又给切回去了,这样改本来是想用wsl的codex,目的没达到啊,都一个月了怎么还没人找到解决方案
the same issue I encounter
记得另外一个issue里提到说把codex app安装位置调整回c盘就正常了;我是直接在wsl2里用codex cli了,感觉还行
codex app安装位置本来就在c盘吧,没招了
要是从微软商店安装的话安装位置可以自定义的,对于win11在系统的 设置,系统,存储,高级存储设置,保存新内容的地方,新的应用将保存到,这个设置项,如果本来就是c盘的话那我就不知道了,我就设置的是d盘
Same for me, but note that this setting was in
.codex/config.tomlnot.codex-global-state.json我也遇到了同样的问题。今天 Codex App 更新到
26.609.4994.0后,原本正常使用的 WSL 模式无法启动。I have the same issue. After updating Codex App to
26.609.4994.0today, the app fails to start in WSL mode.Environment / 环境:
Error / 报错:
Diagnostics / 诊断结果:
From PowerShell:
Output:
But login shell can find Codex:
Output:
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
runCodexInWindowsSubsystemForLinuxto false in.codex/config.tomlallows it to start - non WSL - but that's not a workaround as I need to use 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.
me too !
Perhaps you could try this solution. https://github.com/openai/codex/issues/22672#issuecomment-4697222182
Environment
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:
After configuring this environment variable, Codex has been working normally.
Important Note
There may be a similar Codex installation under:
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\wsldirectory instead.For me, I didn't have a
C:\Users\<YOUR_USERNAME>\.codex\bin\wsldirectory (perhaps I used to but I had deleted contents of.codexand 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
更新 Codex App 后出现:
如果之前在 Codex App 里把 Agent Environment 设置成了 WSL,那么实际上系统里可能同时存在 3 个 Codex:
这是在 Windows 终端里执行
codex用的。例如:
这是你在 Ubuntu/WSL 终端里执行
codex用的。例如:
这是 Codex App 为了桥接 Windows 和 WSL 自动生成的启动器。
问题的根源在于:
很多人会误把环境变量设置到:
或者:
结果会出现各种奇怪错误(
.cmd语法错误、node not found等)。正确修复方法:
先找到 App 自动生成的 WSL Wrapper,找到类似:
然后设置:
验证:
重启 Codex App 即可恢复。
tive o mesmo problema após atualizar ontem. solução foi setar as variáveis de ambiente de volta ao windows.
same
Thank you @black-yt
修改回去
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"
Same problem