Codex suggests incorrect upgrade command: `npm install -g codex` instead of `npm install -g @openai/codex`
Bug Description
When asking Codex how to upgrade itself, it provides an incorrect npm package name, causing users to accidentally install a completely different (and ancient) package.
Steps to Reproduce
- Ask Codex: "How do I upgrade Codex?"
- Codex asks for the path via
command -v codex - After providing the path (
/home/user/.nvm/versions/node/v22.x.x/bin/codex), Codex recommends:
npm install -g codex # โ WRONG
4. User runs the command โ fails with errors
5. Codex then suggests backing up the old binary and retrying the same wrong command
6. User gives up and asks Claude Code, which immediately provides the correct command and successfully upgrades Codex ๐
Expected Behavior
Codex should recommend the correct command:
npm install -g @openai/codex # โ
CORRECT
What Actually Happens
The command npm install -g codex attempts to install https://www.npmjs.com/package/codex - a completely different package from 2012 (a documentation generator) that:
- Requires Node.js 0.4.x - 0.7.x (ancient!)
- Has tons of deprecated dependencies
- Fails with EEXIST error because the real Codex binary already exists
Error Output
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '[email protected]',
npm warn EBADENGINE required: { node: '>= 0.4.1 < 0.7.0' },
npm warn EBADENGINE current: { node: 'v22.21.1', npm: '11.7.0' }
npm warn EBADENGINE }
npm warn deprecated [email protected]: Jade has been renamed to pug...
npm warn deprecated [email protected]: connect 1.x series is deprecated
npm error code EEXIST
npm error path /home/user/.nvm/versions/node/v22.21.1/bin/codex
npm error EEXIST: file already exists
The Irony
Codex couldn't upgrade itself. Claude Code did it in one try with npm update -g @openai/codex.
Environment
- Codex CLI version: 0.80.0 โ 0.86.0 (after Claude Code fixed it)
- Node.js: v22.21.1
- npm: 11.7.0
- OS: Ubuntu (WSL2)
Suggested Fix
Update Codex's response logic to always use the scoped package name @openai/codex when suggesting installation or upgrade commands.
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Incorrect โ Correct โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ npm install -g codex โ npm install -g @openai/codex โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ npm update -g codex โ npm update -g @openai/codex โ
โโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This is model behavior, not something we can fix in the Codex harness itself. We'll share the feedback with the team responsible for training our codex models. If you see other model behavior that you'd like to report, please use the /feedback command. That will provide us with additional details including logs and conversation text.
This is model behavior, not something we can fix in the Codex harness itself. We'll share the feedback with the team responsible for training our codex models. If you see other model behavior that you'd like to report, please use the
/feedbackcommand. That will provide us with additional details including logs and conversation text.่ฟๆฏๆจกๅ่กไธบ๏ผๅนถ้ๆไปฌ่ฝๅจ Codex ๆฒป็ๆกๆถๆฌ่บซไฟฎๅค็้ฎ้ขใๆไปฌไผๅฐๆญคๅ้ฆๅไบซ็ป่ด่ดฃ่ฎญ็ป Codex ๆจกๅ็ๅข้ใๅฆๆๆจๅ็ฐๅ ถไปๆณ่ฆๆฅๅ็ๆจกๅ่กไธบ๏ผ่ฏทไฝฟ็จ/feedbackๅฝไปคใ่ฟๅฐไธบๆไปฌๆไพๅ ๆฌๆฅๅฟๅๅฏน่ฏๆๆฌๅจๅ ็ๆดๅค่ฏฆ็ปไฟกๆฏใ
ok