Skip to content

Codex disappears after an npm upgrade on NFS

Source: Troubleshooting reference

Symptom. codex resume reports command not found; npm install -g @openai/codex@latest fails with EBUSY while unlinking a .nfs… file.

Root cause. An active Codex process holds a file in the npm package tree open. NFS retains that file under a temporary name; npm cannot remove it during package replacement, and the failed replacement can leave a dangling CLI shim. A shell function named codex still appears in which even when the executable it delegates to is gone.

Fix. The managed installer now owns the native executable and stages and verifies its replacement before atomic activation. Run bash ~/dotfiles/install/codex.sh install, then use its upgrade mode for updates. Start a fresh login shell to remove the retired function and inspect type -a codex. Do not remove open .nfs… files or delete the package tree underneath running clients. Restart affected app-server processes when interruption is acceptable; no prompts or paused queues should be replayed automatically.