refactor: extract npm_global_install() helper for sudo-aware global installs#694
refactor: extract npm_global_install() helper for sudo-aware global installs#694marcusquinn merged 1 commit intomainfrom
Conversation
…nstalls All npm global install calls now use a shared helper that: - Prefers bun if available (no sudo needed) - Auto-detects when npm prefix dir isn't writable (Linux apt-installed npm) - Prepends sudo automatically in that case Affected functions: install_mcp_packages, setup_nodejs_env (DSPyGround), setup_localwp_mcp, setup_osgrep, setup_beads_ui (beads-ui, bdui), setup_opencode_cli
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Feb 9 00:16:27 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
Follow-up to PR #693. Extracts the sudo-aware npm global install logic into a shared
npm_global_install()helper function and applies it to all npm global install call sites.Problem
After PR #693 fixed the OpenCode CLI install with sudo detection, the same issue affected every other
npm install -gcall in setup.sh — MCP packages, DSPyGround, LocalWP MCP, osgrep, beads-ui, and bdui all failed with EACCES on Linux systems where npm was installed via apt.Solution
npm_global_install()helper function (line 174) that:~/.bun/bin, no sudo needed)sudoif notnpm install -gcall sites withnpm_global_installsudoAffected functions
install_mcp_packages()— 5 MCP server packagessetup_nodejs_env()— DSPyGroundsetup_localwp_mcp()— LocalWP MCP serversetup_osgrep()— osgrep CLIsetup_beads_ui()— beads-ui, bduisetup_opencode_cli()— OpenCode (was inline, now uses shared helper)Testing
npm_global_installtested directly in OrbStack Ubuntu ARM64 — installs with sudo automatically./setup.sh --non-interactivepasses with exit code 0bash -n setup.shsyntax check passes