Skip to content

Commit 63dddd0

Browse files
committed
fix(installer): clarify macOS admin requirement for Homebrew
1 parent 6169a23 commit 63dddd0

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ These scripts:
5454
4. Run `openclaw doctor --non-interactive` for migrations (upgrades only)
5555
5. Prompt to run `openclaw onboard` (new installs)
5656

57+
Troubleshooting:
58+
- macOS first-run Homebrew bootstrap needs an Administrator account. If install fails with a sudo/admin error, use an admin account (or add the current user to the `admin` group) and rerun the installer.
59+
5760
## Related
5861

5962
- [OpenClaw](https://github.com/openclaw/openclaw) — Main repository

public/install.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,9 +1094,36 @@ detect_openclaw_checkout() {
10941094
}
10951095

10961096
# Check for Homebrew on macOS
1097+
is_macos_admin_user() {
1098+
if [[ "$OS" != "macos" ]]; then
1099+
return 0
1100+
fi
1101+
if is_root; then
1102+
return 0
1103+
fi
1104+
id -Gn "$(id -un)" 2>/dev/null | grep -qw "admin"
1105+
}
1106+
1107+
print_homebrew_admin_fix() {
1108+
local current_user
1109+
current_user="$(id -un 2>/dev/null || echo "${USER:-current user}")"
1110+
ui_error "Homebrew installation requires a macOS Administrator account"
1111+
echo "Current user (${current_user}) is not in the admin group."
1112+
echo "Fix options:"
1113+
echo " 1) Use an Administrator account and re-run the installer."
1114+
echo " 2) Ask an Administrator to grant admin rights, then sign out/in:"
1115+
echo " sudo dseditgroup -o edit -a ${current_user} -t user admin"
1116+
echo "Then retry:"
1117+
echo " curl -fsSL https://openclaw.ai/install.sh | bash"
1118+
}
1119+
10971120
install_homebrew() {
10981121
if [[ "$OS" == "macos" ]]; then
10991122
if ! command -v brew &> /dev/null; then
1123+
if ! is_macos_admin_user; then
1124+
print_homebrew_admin_fix
1125+
exit 1
1126+
fi
11001127
ui_info "Homebrew not found, installing"
11011128
run_quiet_step "Installing Homebrew" run_remote_bash "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
11021129

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const duration2 = (row2.length / 2 * pixelsPerItem) / pixelsPerSecond;
198198
<div class="switch-placeholder" id="switch-placeholder" aria-hidden="true"></div>
199199
</div>
200200
<div id="code-oneliner" class="code-content">
201-
<div class="code-line comment" id="oneliner-comment"># Works everywhere. Installs everything. You're welcome. 🦞</div>
201+
<div class="code-line comment" id="oneliner-comment"># Works everywhere. On macOS, first run may need an Administrator for Homebrew.</div>
202202
<div class="code-line cmd">
203203
<span class="code-prompt">$</span>
204204
<span class="os-cmd">curl -fsSL https://openclaw.ai/install.sh | bash</span>

0 commit comments

Comments
 (0)