Codex suggests incorrect upgrade command: `npm install -g codex` instead of `npm install -g @openai/codex`

Resolved 💬 2 comments Opened Jan 16, 2026 by GavinRiver Closed Jan 16, 2026

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

  1. Ask Codex: "How do I upgrade Codex?"
  2. Codex asks for the path via command -v codex
  3. After providing the path (/home/user/.nvm/versions/node/v22.x.x/bin/codex), Codex recommends:

```bash
npm install -g codex # ❌ WRONG

  1. User runs the command → fails with errors
  2. Codex then suggests backing up the old binary and retrying the same wrong command
  3. 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 │
└──────────────────────┴──────────────────────────────┘

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗