Module
coder-labs/codex
Summary
On the first workspace build the Codex module installs fine. After a
workspace restart/rebuild (where the home directory / npm prefix is on a
persistent volume), the install script fails with npm error code ENOTEMPTY
and Codex is not (re)installed.
What happens
The install step runs npm install -g @openai/codex@latest. npm installs the
new version into a temp dir and then atomically renames it over the existing
@openai/codex directory. When a previous install already exists in the
persistent npm prefix (/home/coder/.npm-global), that rename fails because the
target directory is not empty.
Logs
Success
--------------------------------
codex_version: latest
workdir: /home/coder/project
enable_ai_gateway: false
install_codex: true
model_reasoning_effort:
--------------------------------
\033[0;1m Installing Codex CLI
npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/coder/.npm-global/lib/node_modules/@openai/codex
npm error dest /home/coder/.npm-global/lib/node_modules/@openai/.codex-zW1CjBX3
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/home/coder/.npm-global/lib/node_modules/@openai/codex' -> '/home/coder/.npm-global/lib/node_modules/@openai/.codex-zW1CjBX3'
npm error A complete log of this run can be found in: /home/coder/.npm/_logs/2026-05-29T06_52_58_698Z-debug-0.log
Success
Workaround
Manually deleting the existing package directory makes the next install
succeed:
rm -rf /home/coder/.npm-global/lib/node_modules/@openai/codex
Expected behavior
The install script should be idempotent across restarts — installing or
upgrading Codex even when a prior install already exists in a persistent
npm prefix (e.g. remove the existing package dir before installing, skip the
install when the requested version is already present, or otherwise handle the
existing directory rather than failing).
Module
coder-labs/codexSummary
On the first workspace build the Codex module installs fine. After a
workspace restart/rebuild (where the home directory / npm prefix is on a
persistent volume), the install script fails with
npm error code ENOTEMPTYand Codex is not (re)installed.
What happens
The install step runs
npm install -g @openai/codex@latest. npm installs thenew version into a temp dir and then atomically renames it over the existing
@openai/codexdirectory. When a previous install already exists in thepersistent npm prefix (
/home/coder/.npm-global), that rename fails because thetarget directory is not empty.
Logs
Workaround
Manually deleting the existing package directory makes the next install
succeed:
rm -rf /home/coder/.npm-global/lib/node_modules/@openai/codexExpected behavior
The install script should be idempotent across restarts — installing or
upgrading Codex even when a prior install already exists in a persistent
npm prefix (e.g. remove the existing package dir before installing, skip the
install when the requested version is already present, or otherwise handle the
existing directory rather than failing).