fix: handle npm install failures gracefully instead of crashing installer#24
Merged
fix: handle npm install failures gracefully instead of crashing installer#24
Conversation
…ller The installer crashed with exit status 1 when npm install failed during Phase 3, because unguarded run_command calls allowed set -e to abort the entire post-install action. Changes: - Wrap all npm/yarn install calls in error handlers so failures produce helpful retry messages instead of crashing the installer - Replace mapfile with a bash 3.2-compatible while-read loop (macOS ships bash 3.2 which lacks mapfile, causing an unbound variable crash) - Use test -s instead of test -f when waiting for .cspell.json in the container, so the wait detects empty files from partial filesystem sync - Only emit "Node toolchain installed" when installation actually succeeds Fixes #23
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.
Summary
run_commandcalls in error handlers so failures produce helpful retry messages instead of crashing the entire installer viaset -emapfilewith a bash 3.2-compatiblewhile readloop — macOS ships bash 3.2 which lacksmapfile, causing an unbound variable crash when missing deps are detectedtest -s(non-empty) instead oftest -f(exists) when waiting for.cspell.jsonin the container, so the wait correctly detects empty files from partial filesystem syncTest plan
node install failure does not crash the installer— verifies installer completes successfully when npm install fails, and emits retry instructionscontainer test -s rejects empty files and accepts non-empty files— validates the mechanism behind the CSpell readability checkFixes #23
🤖 Generated with Claude Code