Bug: Codex on PowerShell attempts to run `sh`

Resolved 💬 4 comments Opened Apr 18, 2025 by PramaYudhistira Closed Apr 19, 2025
💡 Likely answer: A maintainer (PramaYudhistira, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

v0.1.2504172351

Which model were you using?

o4-mini

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

  • Run npm i -g @openai/codex
  • Run codex

It will output

& : The term 'sh.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try again.

What is the expected behavior?

Expected behavior is for codex cli to start running properly. This PR shows the expected behavior https://github.com/openai/codex/pull/318

What do you see instead?

A message indicating the powershell shim codex.ps1 is attempting to run sh.exe. This shouldn't be happening because

Additional information

Added a potential fix here https://github.com/openai/codex/pull/318 , this change now provides cross-platform support and works on all CLIs by using a Node based entry point

View original on GitHub ↗

4 Comments

PramaYudhistira contributor · 1 year ago
PramaYudhistira contributor · 1 year ago

I have a fix for this here https://github.com/openai/codex/pull/318 to provide cross-platform support

gitmeatarru · 1 year ago

we waiting update, coz its still not working...

PramaYudhistira contributor · 1 year ago
we waiting update, coz its still not working...

It hasn't been uploaded to npm yet. If you clone the repo and have this running locally instead of getting it from npm you will have all the recent commits.

@gitmeatarru