fix(npm): replace broken postinstall with lazy-download shim#34
Merged
seanseannery merged 4 commits intomainfrom Mar 7, 2026
Merged
fix(npm): replace broken postinstall with lazy-download shim#34seanseannery merged 4 commits intomainfrom
seanseannery merged 4 commits intomainfrom
Conversation
added 4 commits
March 7, 2026 02:39
…npmrc Test was installing from GitHub main (which still has broken postinstall), now installs from local working tree. Removed .npmrc script-shell workaround that was only needed for the old postinstall approach.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key Changes
postinstallscript with a lazy-download shim (install/shim.js) that downloads the platform binary on first use to~/.opsfile/opsGITHUB_TOKENauth headers toinstall.shandnpm_install.jsto avoid GitHub API rate limits in CImacos-latestwithsetup-nodeWhy do we need this?
The npm install via
postinstallscript was broken — npm runs lifecycle scripts in a temp directory that gets removed, causingENOENT: process.cwdfailures. The shim approach avoids lifecycle scripts entirely by deferring the binary download to first invocation.Additionally, the smoke test was always installing from GitHub main (not the branch being tested), so the fix could never actually be validated until merged — a chicken-and-egg problem.
New modules or other dependencies introduced
install/shim.js— new Node.js shim script (no external dependencies, uses onlyhttps,fs,path,os,child_process)How was this tested?
make test-installlocally: 3/3 passed (curl, npm, brew)