Optimize npm package size by downloading platform-specific binaries in postinstall (~100MB -> ~20MB)
Resolved 💬 2 comments Opened Aug 27, 2025 by vinaybantupalli Closed Jan 10, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What feature would you like to see?
The current npm package bundles binaries for all platforms, but only one platform-specific binary is needed per installation.
Current Behavior
- All platform binaries are included via
install_native_deps.shinstage_release.sh - Runtime platform detection in
bin/codex.jsselects the correct binary
Proposed Solution
Replace the current approach with a postinstall script that downloads only the required binary based on the platform:
- Postinstall script detects platform and downloads appropriate binary from GitHub Releases
- Binary to be served from github releases instead of npm registry
- Update
stage_release.shto publish lightweight package
Are you interested in implementing this feature?
Yes
Additional information
Binary will be served from github releases instead of npm registry after this - so need to check how versioning is setup github release packages
2 Comments
I suggest to keep this one https://github.com/openai/codex/issues/6891 actually, since the recommendation how to solve is more on-point. You should not download binaries in post-install, but instead make the extension platform-specific. Post-install downloads might not work for enterprises that have strict network settings. Also the first extension startup will be slower (you have to download)
This feature request hasn't received any upvotes in nearly five months, so closing.