From 5b9673c9474368d12a96a2aa64cc5bf830017320 Mon Sep 17 00:00:00 2001 From: dongsheng123132 <90887123+dongsheng123132@users.noreply.github.com> Date: Thu, 12 Mar 2026 12:00:09 +0800 Subject: [PATCH] fix: correct openclaw.mjs path and remove broken build step - openclaw.mjs is at node_modules/openclaw/openclaw.mjs, not core root - Remove npm run build (openclaw doesn't need a build step via npm) - Fix both Mac-Start.command and Mac-Menu.command --- portable/Mac-Menu.command | 6 ++++-- portable/Mac-Start.command | 10 +++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/portable/Mac-Menu.command b/portable/Mac-Menu.command index 9d0999f..9efedee 100755 --- a/portable/Mac-Menu.command +++ b/portable/Mac-Menu.command @@ -35,9 +35,11 @@ if xattr -l "$NODE_BIN" 2>/dev/null | grep -q "com.apple.quarantine"; then fi # Run openclaw command +OPENCLAW_MJS="$CORE_DIR/node_modules/openclaw/openclaw.mjs" + run_oc() { cd "$CORE_DIR" - "$NODE_BIN" openclaw.mjs "$@" + "$NODE_BIN" "$OPENCLAW_MJS" "$@" } # Show menu @@ -110,7 +112,7 @@ do_dashboard() { local TOKEN=$(python3 -c "import json,os; p='$CONFIG_PATH'; d=json.load(open(p)) if os.path.exists(p) else {}; print(d.get('gateway',{}).get('auth',{}).get('token','uclaw'))" 2>/dev/null || echo "uclaw") - "$NODE_BIN" openclaw.mjs gateway run --allow-unconfigured --force --port $PORT & + "$NODE_BIN" "$OPENCLAW_MJS" gateway run --allow-unconfigured --force --port $PORT & local PID=$! for i in $(seq 1 30); do diff --git a/portable/Mac-Start.command b/portable/Mac-Start.command index 2fdbe41..bafb451 100755 --- a/portable/Mac-Start.command +++ b/portable/Mac-Start.command @@ -106,12 +106,7 @@ if [ ! -d "$CORE_DIR/node_modules" ]; then echo "" fi -if [ ! -d "$CORE_DIR/dist" ]; then - echo -e " ${YELLOW}First run - building...${NC}" - cd "$CORE_DIR" - "$NODE_BIN" "$NODE_DIR/bin/npm" run build 2>&1 - echo "" -fi +# OpenClaw doesn't need a separate build step when installed via npm # ---- 8. Find available port ---- PORT=18789 @@ -146,7 +141,8 @@ cd "$CORE_DIR" TOKEN=$(python3 -c "import json,os; p='$STATE_DIR/openclaw.json' if os.path.exists('$STATE_DIR/openclaw.json') else '$DATA_DIR/config.json'; d=json.load(open(p)); print(d.get('gateway',{}).get('auth',{}).get('token','uclaw'))" 2>/dev/null || echo "uclaw") -"$NODE_BIN" openclaw.mjs gateway run --allow-unconfigured --force --port $PORT & +OPENCLAW_MJS="$CORE_DIR/node_modules/openclaw/openclaw.mjs" +"$NODE_BIN" "$OPENCLAW_MJS" gateway run --allow-unconfigured --force --port $PORT & GW_PID=$! # ---- 10. Wait & open browser ----