codex icon indicating copy to clipboard operation
codex copied to clipboard

[Windows][WSL] Desktop connection fails to detect Codex installed via npm under NVM

Open sd68515 opened this issue 1 week ago • 0 comments

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

26.1117.31558 (Microsoft Store package 26.1117.3838.0)

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Microsoft Windows NT 10.0.26300.0 x64; Ubuntu 24.04 LTS on WSL2 (WSL 3.0.5)

What issue are you seeing?

The ChatGPT desktop app detected my Ubuntu WSL2 distribution but could not connect. Codex CLI 0.171.0 was already installed globally via npm under NVM and was signed in and working in the Ubuntu terminal. The desktop app attempted to download a Linux runtime and showed “Could not connect to the remote device.” The desktop logs recorded a timeout on one attempt and Could not download or install Codex in WSL: net::ERR_CONNECTION_CLOSED on another.

What steps can reproduce the bug?

  1. In Ubuntu on WSL2, use Node.js managed by NVM. I was using Node v22.23.4.
  2. Run npm install -g @openai/[email protected]. Confirm that command -v codex points to ~/.nvm/versions/node/v22.23.4/bin/codex and that codex login status reports an active login. In my setup, there was no ~/.local/bin/codex.
  3. In the Windows ChatGPT desktop app, open Settings → Connections → WSL and enable WSL: Ubuntu.
  4. The app attempts to download its own Linux runtime and the connection fails.

What is the expected behavior?

The desktop app should find and reuse the supported Codex CLI already installed in Ubuntu through npm under NVM, then connect without downloading a second runtime.

Additional information

I reproduced a PATH difference during diagnosis. A normal Ubuntu login shell found codex, while the PATH obtained using the desktop app’s probing approach omitted the NVM directory. The desktop logs did not record the exact PATH used during the failed connection. Installing the standalone CLI at ~/.local/bin/codex resolved the connection on my machine.

Related to #60549. In my case, the desktop app attempted to download a Linux runtime and failed with net::ERR_CONNECTION_CLOSED. I did not observe the Windows npm shim or the exec: node: not found error reported there.

sd68515 avatar Nov 20 '26 10:11 sd68515