bin/codex.js missing execute permission after npm install

Resolved 💬 2 comments Opened Jan 20, 2026 by LixvYang Closed Jan 20, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

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 ↗

2 Comments

etraut-openai contributor · 7 months ago

Which platform are you on?

By any chance, have you seen this problem with previous versions?

LixvYang · 7 months ago
Which platform are you on?你使用的是哪个平台? By any chance, have you seen this problem with previous versions?你之前版本是否遇到过这个问题?

ARM64 darwin. I've encountered this issue several times already.