bin/codex.js missing execute permission after npm install

Resolved 💬 2 comments Opened Jan 20, 2026 by LixvYang Closed Jan 20, 2026

Problem

When installing @openai/codex globally via npm, the bin/codex.js file does not have execute permissions, causing the codex command to fail.

Verification from npm tarball:

curl -sL https://registry.npmjs.org/@openai/codex/-/codex-0.87.0.tgz | tar -tzv | grep "bin/codex.js"
# Output: -rw-r--r--  0 0      0        4997 Oct 26  1985 package/bin/codex.js

The file has permissions 644 (read/write only), missing the execute bit.

Reproduction:

npm install -g @openai/codex
codex --version
# Error: permission denied or command not found

Workaround:

chmod +x $(npm root -g)/@openai/codex/bin/codex.js

Suggested Fix

Before publishing, ensure the binary has execute permissions:

chmod +x bin/codex.js
npm pack  # Verify permissions are preserved
npm publish

This will ensure npm installations work out-of-the-box without manual permission fixes.

Environment

  • npm version: (varies)
  • Node.js: (varies)
  • @openai/codex version: 0.87.0

View original on GitHub ↗

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