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:
```bash
npm install -g codex # ❌ WRONG
- User runs the command → fails with errors
- Codex then suggests backing up the old binary and retrying the same wrong command
- 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: 'connect@1.8.7',
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 jade@0.26.3: Jade has been renamed to pug...
npm warn deprecated connect@1.8.7: 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 │
└──────────────────────┴──────────────────────────────┘
2 Comments
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.ok