Skip to content

fix: handle npm install failures gracefully instead of crashing installer#24

Merged
UltraBob merged 1 commit intomainfrom
fix/phase3-install-resilience
Mar 24, 2026
Merged

fix: handle npm install failures gracefully instead of crashing installer#24
UltraBob merged 1 commit intomainfrom
fix/phase3-install-resilience

Conversation

@UltraBob
Copy link
Owner

Summary

  • Wraps all npm/yarn run_command calls in error handlers so failures produce helpful retry messages instead of crashing the entire installer via set -e
  • Replaces mapfile with a bash 3.2-compatible while read loop — macOS ships bash 3.2 which lacks mapfile, causing an unbound variable crash when missing deps are detected
  • Uses test -s (non-empty) instead of test -f (exists) when waiting for .cspell.json in the container, so the wait correctly detects empty files from partial filesystem sync
  • Only emits "Node toolchain installed" when installation actually succeeds

Test plan

  • New test: node install failure does not crash the installer — verifies installer completes successfully when npm install fails, and emits retry instructions
  • New test: container test -s rejects empty files and accepts non-empty files — validates the mechanism behind the CSpell readability check
  • Updated existing node install test assertions to match new message flow
  • All 33 non-full tests pass

Fixes #23

🤖 Generated with Claude Code

…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
@UltraBob UltraBob merged commit fc3ef84 into main Mar 24, 2026
3 checks passed
@UltraBob UltraBob deleted the fix/phase3-install-resilience branch March 24, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 3 installation failure

1 participant