Overview
Therepair command scans for projects with corrupted or broken dependencies and automatically fixes them by removing and reinstalling. This is safer than sweep because it only touches projects that are actually broken.
Use this command when:
- Dependencies are corrupted or incomplete
- Package installations failed midway
- You suspect missing packages causing runtime errors
- You want to verify and fix dependency health across multiple projects
Usage
Flags
Root path to scan. Defaults to the current directory. Scans recursively through all subdirectories.
Show details for all projects, including healthy ones. By default, only broken projects are shown.
Display help information for the repair command.
Examples
Repair Current Directory
Scan and fix broken dependencies:Repair with Verbose Output
Show details for healthy projects too:Repair Specific Directory
Scan a specific path:Check All Projects Verbosely
Audit all projects and show their health status:Health Check Methods
Pumu uses different health check strategies per package manager:| Ecosystem | Health Check Method | What It Detects |
|---|---|---|
| npm | npm ls --json | Missing packages, version mismatches, corrupted installations |
| pnpm | pnpm ls --json | Missing packages, integrity issues, broken symlinks |
| yarn | yarn check --verify-tree | Dependency tree corruption, checksum mismatches |
| bun | bun install --dry-run | Missing packages, version conflicts |
| cargo | cargo check | Compilation errors, missing dependencies |
| go | go mod verify | Module integrity, checksum verification |
| pip | pip check | Broken dependencies, incompatible versions |
How Repair Works
- Scans recursively - Finds all project directories by detecting package manager files
- Runs health checks - Uses package manager-specific commands to detect issues
- Identifies broken projects - Determines which projects need fixing
- Removes corrupt folders - Deletes the dependency folder (node_modules, target, etc.)
- Reinstalls fresh - Runs the package manager’s install command
- Verifies repair - Checks if the project is now healthy
- Reports results - Shows which projects were fixed and which were already healthy
Common Use Cases
Fix Runtime Errors
When you get “module not found” errors:Audit All Projects
Check health across all projects:Fix After Failed Installation
Whennpm install or similar commands fail:
Verify Environment After Updates
After updating Node.js, Rust, or other tools:Batch Repair Multiple Projects
Fix all broken projects in your workspace:Pre-deployment Check
Verify all dependencies before deploying:Repair vs. Sweep
| Feature | repair | sweep |
|---|---|---|
| Purpose | Fix broken dependencies | Free up disk space |
| Detection | Health checks | Size calculation |
| Action | Only repairs broken projects | Deletes selected folders |
| Safety | Very safe - only touches broken projects | Requires explicit selection |
| Speed | Slower (runs health checks) | Faster (just calculates sizes) |
| Use case | Fix errors | Clean up space |
Performance Considerations
- Health checks can be slow - Package manager verification commands (especially
cargo checkandnpm ls) can take time on large projects - Concurrent execution - Multiple health checks run in parallel for speed
- Smart caching - Some package managers cache verification results
- Graceful failures - If a health check times out, the project is skipped
The
--verbose flag is useful for auditing, but can produce a lot of output on large workspaces. Use it selectively.Output Interpretation
Symbols and Colors
- ✅ Green checkmark - Project is healthy or was successfully repaired
- ❌ Red X - Project has broken dependencies
- 📁 Folder icon - Project path and detected package manager
- 🗑️ Trash icon - Removing corrupted dependency folder
- 📦 Package icon - Reinstalling dependencies
Exit Codes
0- All projects healthy or successfully repaired1- One or more projects could not be repaired
Limitations
- Requires package managers - The tool must be able to run
npm,cargo, etc. - Network dependent - Reinstalling requires internet access
- Time consuming - Health checks and reinstalls can take minutes on large projects
- Not all errors detected - Some subtle corruption may not be caught by standard health checks
Related Commands
- Default mode - Refresh a single project (similar to repair but for one project)
sweep- Delete dependency folders to free spacelist- View all dependency folders without actionprune- Smart cleanup based on staleness