codex icon indicating copy to clipboard operation
codex copied to clipboard

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

Open Adaozuishuai opened this issue 6 months ago • 26 comments

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

Adaozuishuai avatar May 13 '26 03:05 Adaozuishuai

the same issue I encounter

vcerfe avatar May 13 '26 13:05 vcerfe

the same issue I encounter

benname avatar May 14 '26 15:05 benname

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

1ceS1amese avatar May 15 '26 02:05 1ceS1amese

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

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

benname avatar May 15 '26 10:05 benname

是的

曙光 @.***

1ceS1amese avatar May 15 '26 13:05 1ceS1amese

i think this dup to this issues #22672

thanh125643 avatar May 15 '26 17:05 thanh125643

me too

Zhangchunqin avatar May 16 '26 14:05 Zhangchunqin

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

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

Adaozuishuai avatar May 20 '26 06:05 Adaozuishuai

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

Adaozuishuai avatar May 20 '26 06:05 Adaozuishuai

备份并重置一下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了

QwQ-is-not-available avatar May 22 '26 23:05 QwQ-is-not-available

备份并重置一下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,目的没达到啊,都一个月了怎么还没人找到解决方案

JunieXD avatar Jun 09 '26 05:06 JunieXD

the same issue I encounter

thosehow avatar Jun 09 '26 05:06 thosehow

备份并重置一下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了,感觉还行

QwQ-is-not-available avatar Jun 09 '26 05:06 QwQ-is-not-available

备份并重置一下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盘吧,没招了

JunieXD avatar Jun 09 '26 05:06 JunieXD

备份并重置一下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盘

QwQ-is-not-available avatar Jun 09 '26 05:06 QwQ-is-not-available

备份并重置一下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

BretJohnson avatar Jun 13 '26 01:06 BretJohnson

我也遇到了同样的问题。今天 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。

hit-ws avatar Jun 13 '26 01:06 hit-ws

我也遇到了同样的问题。今天 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.

BretJohnson avatar Jun 13 '26 01:06 BretJohnson

我也遇到了同样的问题。今天 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.

Bagel-Badge avatar Jun 13 '26 01:06 Bagel-Badge

我也遇到了同样的问题。今天 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 avatar Jun 13 '26 01:06 cls1277