This guide covers common issues and their solutions when using the macOS Development Setup.
- Installation Issues
- Script Errors
- Homebrew Problems
- Git Configuration
- MCP Server Issues
- Permission Issues
- Network Problems
- Tool-Specific Issues
- Shell Configuration
- Recovery Options
Problem: Scripts fail with "command not found" errors.
Solutions:
-
Ensure Homebrew is installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Add Homebrew to PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile source ~/.zprofile
-
Restart your terminal or run:
source ~/.zshrc
Problem: Running on non-macOS system.
Solution: This setup is specifically designed for macOS only. It is not compatible with other operating systems.
Problem: Not enough free disk space.
Solutions:
-
Check available space:
df -h /
-
Free up space:
# Clean Homebrew cache brew cleanup -s # Remove old iOS backups # Go to: About This Mac > Storage > Manage > iOS Files # Clear Downloads folder rm -rf ~/Downloads/*
-
Use external storage for large tools
Problem: CI environment has bash 3.2, scripts require bash 4+
Solutions:
-
Scripts automatically detect CI mode and adjust:
CI=true ./setup.sh
-
Use fallback syntax for older bash:
# Modern bash 4+ syntax declare -A map=() # Fallback for bash 3.2 declare -a keys=() declare -a values=()
Problem: Scripts don't have execute permissions.
Solution:
chmod +x setup.sh
chmod +x scripts/*.sh
chmod +x tests/*.shProblem: Running script from wrong directory.
Solution: Always run from repository root:
cd /path/to/macbook-dev-setup
./setup.shProblem: Shell compatibility issues.
Solutions:
-
Ensure using bash (not sh):
bash setup.sh
-
Check bash version:
bash --version # Should be 3.2 or higher -
Use correct shebang:
#!/usr/bin/env bash # Correct #!/bin/bash # May fail in some environments
Problem: Cleanup not happening on script interruption.
Solution: Ensure proper signal traps:
# Check if script has proper traps
grep "trap.*INT TERM" script.sh
# Should see something like:
trap cleanup EXIT INT TERM HUPSee Signal Safety Guide for details.
Problem: Cannot install Homebrew.
Solutions:
-
Check Xcode Command Line Tools:
xcode-select --install
-
Reset Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Fix permissions:
sudo chown -R $(whoami) /opt/homebrew
Problem: Homebrew not in PATH.
Solution: Add to shell profile:
# For Apple Silicon Macs
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
# For Intel Macs
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
# Reload shell
source ~/.zprofileProblem: Individual packages fail.
Solutions:
-
Update Homebrew:
brew update brew upgrade
-
Fix specific formula:
brew uninstall --force <formula> brew install <formula>
-
Check for conflicts:
brew doctor
Problem: Git using placeholder values.
Solution: Update Git configuration:
git config --global user.name "Your Actual Name"
git config --global user.email "your.email@example.com"Problem: Certificate verification issues.
Solutions:
-
Update certificates:
brew install ca-certificates
-
Temporary workaround (not recommended):
git config --global http.sslVerify false
Problem: Git opens wrong editor or nano.
Solution: Script auto-configures vim/nvim:
# Check current editor
git config --global core.editor
# Manually set if needed
git config --global core.editor "nvim" # or "vim"Problem: Claude Desktop doesn't recognize installed servers.
Solutions:
- Restart Claude Desktop after configuration
- Check config file:
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json | jq
- Fix configuration:
./scripts/fix-mcp-servers.sh
Problem: Claude Code can't access MCP servers.
Solutions:
-
List current servers:
claude mcp list
-
Re-add servers:
claude mcp remove <server> ./scripts/setup-claude-code-mcp.sh
-
Check configuration:
claude settings show
Problem: Exa server fails with auth errors (Figma is now a plugin using hosted OAuth — no API key needed).
Solutions:
-
Ensure API key is set:
# Check if key is exported echo $EXA_API_KEY
-
Add to shell config:
echo 'export EXA_API_KEY="your-key-here"' >> ~/.config/zsh/51-api-keys.zsh source ~/.zshrc
-
Verify with debug script:
./scripts/debug-mcp-servers.sh
Problem: Servers fail to install or build.
Solutions:
-
Check Node.js version:
node --version # Should be 18+ -
Clean and reinstall:
rm -rf ~/repos/mcp-servers ./scripts/setup-claude-mcp.sh -
Install specific servers:
./scripts/fix-mcp-servers.sh --servers filesystem,memory,git
Problem: macOS security restrictions.
Solutions:
-
Grant Terminal full disk access:
- System Preferences → Security & Privacy → Privacy → Full Disk Access
- Add Terminal.app
-
For specific directories:
sudo chown -R $(whoami) /path/to/directory
Problem: System Integrity Protection (SIP) blocking changes.
Solution: Don't disable SIP. Instead:
- Use user-specific configurations (~/.config/)
- Install tools in Homebrew locations
- Use sudo only when absolutely necessary
Problem: Network connectivity issues.
Solutions:
-
Check connectivity:
./scripts/health-check.sh | grep -A5 "network"
-
Use different mirror:
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles -
Increase timeout:
export HOMEBREW_CURL_TIMEOUT=300
Problem: Proxy blocking connections.
Solution: Configure proxy:
export http_proxy=http://proxy.company.com:8080
export https_proxy=$http_proxy
export no_proxy=localhost,127.0.0.1Problem: npm commands fail.
Solutions:
-
Reinstall Node.js:
nvm uninstall node nvm install node
-
Clear npm cache:
npm cache clean --force
-
Fix permissions:
npm config set prefix ~/.npm echo 'export PATH="$HOME/.npm/bin:$PATH"' >> ~/.zshrc
Problem: Python packages won't install.
Solutions:
-
Use pyenv:
pyenv install 3.12.8 pyenv global 3.12.8
-
Upgrade pip:
pip install --upgrade pip
-
Use virtual environments:
python -m venv myenv source myenv/bin/activate
Problem: code command not found.
Solution: Install shell command:
- Open VS Code
- Press Cmd+Shift+P
- Type "Shell Command: Install 'code' command in PATH"
- Restart terminal
Problem: Docker commands fail.
Solutions:
- Ensure Docker Desktop is running
- Check Docker context:
docker context ls docker context use default
- Reset Docker:
# In Docker Desktop: Preferences → Reset → Reset to factory defaults
Problem: Terminal takes long to open.
Solutions:
-
Profile startup time:
time zsh -i -c exit
-
Check for slow commands:
zsh -xv 2>&1 | ts -i "%.s"
-
Optimize NVM loading (already done by setup):
# Lazy load NVM export NVM_LAZY_LOAD=true
Problem: Custom aliases not available.
Solutions:
-
Check if aliases are loaded:
alias | grep your_alias
-
Reload configuration:
source ~/.zshrc
-
Check modular config files:
ls ~/.config/zsh/ # Should see numbered files like 10-aliases.zsh
Problem: gw, gwcd commands not working.
Solution: Ensure functions are loaded:
# Check if loaded
type gw
# Manually source if needed
source ~/.config/zsh/40-git-helpers.zshList available restore points:
./scripts/rollback.sh --listRestore from latest:
./scripts/rollback.sh --latestRestore specific point:
./scripts/rollback.sh --restore "2024-01-15_10-30-45"View backups:
./setup.sh backupMigrate old backups:
./setup.sh backup migrateClean old backups:
./setup.sh backup clean-
Backup current state:
mkdir ~/setup_backup cp -r ~/.zshrc ~/.gitconfig ~/.config ~/setup_backup/
-
Run health check:
./scripts/health-check.sh > health_report.txt -
Selective reinstall:
# Just Homebrew packages brew bundle --file=homebrew/Brewfile # Just dotfiles ./scripts/setup-dotfiles.sh # Just MCP servers ./scripts/setup-claude-mcp.sh
Warning: This removes everything!
# 1. Uninstall everything
./scripts/uninstall.sh
# 2. Clean up
rm -rf ~/.setup-backups
rm -rf ~/.setup_restore
# 3. Fresh install
./setup.shCollect system info for bug reports:
# System info
sw_vers
uname -a
# Tool versions
brew --version
node --version
python --version
# Health check
./scripts/health-check.sh > diagnostic.txt
# Recent errors
tail -n 50 setup.logRun scripts with debug output:
# Verbose mode
SETUP_VERBOSE=1 ./setup.sh
# With logging
SETUP_LOG=debug.log ./setup.sh
# Bash debug mode
bash -x ./setup.sh# Test MCP servers
./scripts/debug-mcp-servers.sh
# Test signal handling
./tests/test_signal_handling.sh
# Test backup system
./tests/test_backup_system.sh
# Run all tests
./tests/run_tests.sh- Check existing issues on GitHub
- Create detailed bug report with:
- macOS version
- Hardware type (M1/M2/M3/Intel)
- Complete error messages
- Steps to reproduce
- Output from health check
If the setup completely breaks your system:
- Boot into Recovery Mode (Cmd+R during startup)
- Use Time Machine to restore
- Reinstall macOS if necessary
-
Always use preview first:
./setup.sh preview
-
Create restore points:
# Before major changes source lib/common.sh create_restore_point "before_experiment"
-
Keep backups:
- Time Machine
- Cloud backups
- Git repositories
-
Test in isolation:
- Use a separate user account
- Test in a VM if possible
- Run tests before committing
-
Use the fix command:
./setup.sh fix
Remember: The health check script is your friend! Run it regularly:
./scripts/health-check.sh- Check disk space:
df -h - Check permissions:
ls -la ~/ - Manually create:
mkdir -p ~/.setup-backups
- Rebuild servers:
./scripts/setup-claude-mcp.sh - Check Node modules:
ls ~/repos/mcp-servers/*/node_modules
- Reduce parallel jobs:
SETUP_JOBS=2 ./setup.sh - Run sequentially:
SETUP_JOBS=1 ./setup.sh
- Check for duplicate traps:
trap -p - Source issue: Don't source setup scripts, execute them
- List versions:
pyenv versions - Set global:
pyenv global 3.12.8 - Rehash:
pyenv rehash