Skip to content

[Bug]: install.sh unconditionally runs install_homebrew on macOS even when adequate Node is already present #83232

Description

@dacoliveira-dot

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

install.sh calls install_homebrew unconditionally before any Node version check, so users without Homebrew (and without macOS admin rights) cannot install OpenClaw even when they already have a Node runtime that satisfies the script's own minimum.

Steps to reproduce

  1. macOS account without admin/sudo and without Homebrew.
  2. Have Node ≥22.14 already on PATH (e.g. /usr/local/bin/node v24.15.0).
  3. Run curl -fsSL https://openclaw.ai/install.sh | bash.
  4. Installer reaches the Homebrew step, tries to install Homebrew, and aborts.

Expected behavior

The installer should detect that the existing Node already satisfies NODE_MIN_VERSION (22.14) and skip install_homebrew entirely, since brew is only needed downstream to install node@24 when Node is missing or outdated.

Actual behavior

scripts/install.sh calls install_homebrew in main() (around the "[1/3] Preparing environment" stage) before any check_node call. On a non-admin macOS without brew, this fails with:

[1/3] Preparing environment
· Homebrew not found, installing
· Installing Homebrew
✗ Installing Homebrew failed — re-run with --verbose for details
Warning: Running in non-interactive mode because `stdin` is not a TTY.
==> Checking for `sudo` access (which may request your password)...
Need sudo access on macOS (e.g. the user dacoliveira needs to be an Administrator)!

install.sh then exits before Node detection runs. Workaround: bypass the installer entirely with npm i -g openclaw@latest (with the usual npm config set prefix ~/.npm-global permission workaround). That path completes cleanly and produces a working CLI, confirming brew is not actually required when Node is already present.

OpenClaw version

install.sh from https://openclaw.ai/install.sh as of 2026-05-17 (would install 2026.5.12 (f066dd2))

Operating system

macOS 15.x (Darwin 25.4.0)

Install method

curl -fsSL https://openclaw.ai/install.sh | bash (canonical one-liner)

Model

N/A (installation phase, no model invoked)

Provider / routing chain

N/A

Additional provider/model setup details

N/A

Logs, screenshots, and evidence

🦞 OpenClaw Installer
✓ Detected: macos
Install plan
OS: macos
Install method: npm
Requested version: latest
Onboarding: skipped

[1/3] Preparing environment
· Homebrew not found, installing
· Installing Homebrew
✗ Installing Homebrew failed — re-run with --verbose for details
Need sudo access on macOS (e.g. the user dacoliveira needs to be an Administrator)!

Impact and severity

Medium. Blocks first-run install for any macOS user without admin/sudo and without Homebrew, even when they already have an adequate Node. Workaround exists (npm i -g openclaw@latest with manual prefix), but it's undocumented from the install page and requires understanding npm prefix permissions.

Hits hardest in: shared/family Macs (kid accounts), corporate-locked Macs, accounts where Homebrew was intentionally avoided.

Suggested fix

Reorder main() so install_homebrew is only called when install_node would actually need brew:

load_nvm_for_node_detection
if ! check_node; then
  install_homebrew      # only macOS users without adequate Node need brew
  install_node
fi

Or move install_homebrew inside install_node where its dependency actually lives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions