| name | infrastructure-debugging |
| description | Troubleshooting dependencies, installations, environment issues, and platform-specific problems. Use when facing npm/pip/package errors, installation failures, environment setup issues, or platform compatibility problems. |
Infrastructure Debugging
Dependency Resolution Strategy
When Facing Package Errors
- Read the full error: Scroll up to find the root cause, not just the final message
- Check version compatibility: Many issues stem from version mismatches
- Clear caches first:
npm cache clean --forceorpip cache purge - Try fresh install: Delete lock files and node_modules/venv, reinstall
- Check peer dependencies: Especially for React, TypeScript, and build tools
Common Package Manager Issues
npm/yarn/pnpm:
ERESOLVEerrors: Try--legacy-peer-depsor update conflicting packagesEACCESpermission errors: Don't use sudo, fix npm permissions instead- Phantom dependencies: Use
pnpmfor stricter resolution
pip/poetry/uv:
- Version conflicts: Use virtual environments, always
- Build failures: Check for missing system dependencies (gcc, python-dev)
- Wheel issues: Try
--no-binary :all:or update pip
Environment Setup
Best Practices
- Isolate environments: Use venv, nvm, containers
- Document versions: Pin exact versions for reproducibility
- Check PATH: Many issues come from wrong binary being used
- Verify installation: Test imports/commands after installing
Platform-Specific Issues
Windows:
- Path length limits (260 chars): Enable long paths or use shorter paths
- Line endings: Configure git to handle CRLF/LF properly
- Native modules: May need Visual Studio Build Tools
- WSL vs native: Know which environment you're targeting
macOS:
- Xcode Command Line Tools required for many packages
- Homebrew vs system Python: Be explicit about which
- M1/M2 ARM: Some packages need Rosetta or ARM builds
Linux:
- Missing system dependencies: Check package manager (apt, yum, etc.)
- Permission issues: Avoid sudo for user packages
- Library paths: Check LD_LIBRARY_PATH if linking fails
Troubleshooting Checklist
- What exact error message?
- What OS and version?
- What package manager and version?
- What Node/Python/runtime version?
- Is this a fresh install or upgrade?
- What changed recently?
Accumulated Learnings
See learnings.md for session-learned insights about infrastructure issues.