-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Problem
When node-pty fails to load (e.g., missing prebuilt binaries), users see a cryptic error:
Error: posix_spawnp failed.
No context on what went wrong or how to fix it.
Proposed Solutions
1. Startup diagnostics
Wrap node-pty import with helpful error handling:
let pty;
try {
pty = await import('node-pty');
} catch (err) {
console.error(`[shellwright] Failed to load node-pty native module.`);
console.error(`[shellwright] This usually means compilation failed during install.`);
console.error(`[shellwright] Try: npm install -g @dwmkerr/shellwright`);
console.error(`[shellwright] Or install build tools: xcode-select --install (macOS)`);
console.error(`[shellwright] Original error:`, err.message);
process.exit(1);
}2. Add --verbose flag
shellwright --verboseOutputs:
- Node version
- Platform/arch
- node-pty binding path
- Any load errors
3. Document npx debugging
Add to README troubleshooting:
# See npx installation logs
npm_config_loglevel=verbose npx -y @dwmkerr/shellwright
# Or check npm cache
ls ~/.npm/_npx/*/node_modules/node-pty/build/4. Health check endpoint (HTTP mode)
GET /health → { "status": "ok", "node_pty": "loaded", "version": "0.1.4" }
Acceptance Criteria
- Startup catches node-pty load failures with actionable message
-
--verboseflag shows diagnostic info - README documents how to debug installation issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels