npm install exits 0 and leaves broken Codex CLI when platform tarball download fails
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
npm install -g @openai/codex can exit successfully after the required platform tarball fails to download, leaving a Codex CLI installation that cannot start.
In this case, the Linux x64 platform package was already published and resolvable. The npm debug log records ECONNRESET while fetching its tarball. Because the platform package is an aliased optionalDependency, npm dropped it from the tree, returned exit code 0, and printed a successful-looking install summary. The installed JavaScript launcher then failed immediately with Missing optional dependency @openai/codex-linux-x64.
Environment
- Codex CLI:
0.150.1 - Node.js:
v24.13.0 - npm:
11.7.0 - OS: Ubuntu 24.04.1 LTS under WSL2
- Kernel:
6.6.87.2-microsoft-standard-WSL2 - Architecture: Linux x64
- Install method: global npm install under nvm
- npm registry:
https://registry.npmjs.org/ - No npm proxy, custom registry, or
omit=optionalconfiguration
Observed behavior
Running:
$ npm install -g @openai/codex
added 1 package, and changed 1 package in 36s
$ codex --version
Error: Missing optional dependency @openai/codex-linux-x64. Reinstall Codex: npm install -g @openai/codex@latest
Relevant excerpts from the npm debug logs across retries:
http fetch GET https://registry.npmjs.org/@openai/codex/-/codex-0.150.1-linux-x64.tgz attempt 1 failed with ECONNRESET
verbose reify failed optional dependency <home>/.nvm/versions/node/v24.13.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64
silly reify mark deleted [
'<home>/.nvm/versions/node/v24.13.0/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64'
]
verbose exit 0
info ok
Several reinstalls ended this way: the wrapper was installed, the platform package was absent, and npm still exited 0.
A later retry using the same Node, npm, OS, configuration, Codex version, and registry succeeded:
http fetch GET 200 https://registry.npmjs.org/@openai/codex/-/codex-0.150.1-linux-x64.tgz 31294ms (cache miss)
silly ADD node_modules/@openai/codex/node_modules/@openai/codex-linux-x64
verbose exit 0
info ok
After that download completed, both the launcher and native binary reported codex-cli 0.150.1. The cached 129,212,827-byte tarball's SHA-512 also matched the registry integrity value.
This was not a platform-package publication race
Registry publish times from npm view @openai/codex time --json:
0.150.1 2026-08-27T02:01:46.851Z
0.150.1-linux-x64 2026-08-27T02:07:53.949Z
The failed installs occurred around 2026-08-27T14:41Z through 15:01Z, more than twelve hours after the Linux package was published. The package metadata resolved correctly; its large tarball fetch failed in transit.
This distinguishes the incident from openai/codex-action#158, where installation began before the platform artifact was available.
Expected behavior
An installation must not report success if the executable required for the current platform was not installed. At minimum, one of these should happen:
- The npm install exits nonzero when the current platform package cannot be fetched or extracted.
- A post-install check verifies that the current platform executable exists and is runnable.
- The installer retries or explicitly installs the selected platform package as a required dependency.
- The launcher error explains that npm may have silently skipped a failed optional-dependency download and provides a deterministic repair command.
--include=optional alone does not address this case: the dependency is considered for installation, but a fetch failure can still be suppressed because it remains optional.
Related issues and packaging change
- openai/codex#13555 tracks the same startup symptom, but reports possible OS/CPU pruning and Node/npm compatibility rather than a captured platform-tarball transport failure.
- openai/codex-action#158 tracks silent success caused by platform artifacts not being published yet.
- openai/codex#11339 introduced the aliased platform
optionalDependenciespackaging scheme.
The transport reset itself may be transient and outside Codex's control. The actionable Codex issue is that a transient fetch failure is converted into a successful but unusable installation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the @openai/codex npm package's aliased platform optionalDependencies and the codex launcher entry point described in the report. Reproduce a failed Linux x64 tarball fetch and inspect the resulting npm status and launcher error. Done means a failed required-platform installation is reported as unsuccessful or gives a deterministic repair path, without leaving a successful-looking broken install.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- cli, release
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100