加拿大機房 M4 遠端 Mac 裝 OpenClaw,最常踩路徑分裂:install.sh 落點、互動 shell 與 launchd 的 PATH、Brew Node 與 npm i -g 誰在前。下文對齊路徑、Brew/npm 分工與 127.0.0.1:18789 資源;延伸 onboard/LaunchDaemon/日誌,隧道見 SSH 與閘道排障。
install.sh 與「誰在 PATH 裡」
指令稿多半下載 release、解壓到固定前綴(如 ~/.openclaw,以官方說明為準),再請你把目錄加進 PATH。請用同一登入使用者跑安裝與 openclaw doctor,並記錄 which openclaw 給 plist。若 SSH 裡 doctor 全綠、daemon 卻 command not found,幾乎是 plist 沒帶到互動 PATH,應改絕對路徑或 EnvironmentVariables,見 onboard 與守護程序實戰。
type -a openclaw openclaw doctor
Homebrew 與 npm:分工對照
| 維度 | Homebrew | npm 全域 |
|---|---|---|
| 用途 | Node LTS、git、憑證鏈 | 同堆疊 CLI |
| PATH | /opt/homebrew/bin 等固定前綴 |
隨 npm prefix/Node 來源而變 |
| Gateway | 讓 launchd 找到穩定 node |
讓 openclaw 與 lockfile 一致 |
runbook 建議:加拿大節點 Brew 裝 Node LTS、官方稿裝 openclaw,避免 Brew/npm 混用讓 doctor 不一致。
Gateway 18789 與資源
本機 127.0.0.1:18789 時,開銷在編排與日誌 IO;記憶體要容納 heap、通道與快取。24GB 機建議為閘道+常駐程序留 6–8GB 水位;日誌與 npm cache 獨立目錄,避免根分割區被 Time Machine 或下載塞滿。
常見報錯(先查這裡)
| 現象 | 先查 | 動作 |
|---|---|---|
daemon 才 command not found |
plist PATH | 絕對路徑+補 Brew 前綴 |
EADDRINUSE:18789 |
重複 job | lsof -i :18789;bootout 後只留一份 |
| 模組找不到/版本漂 | Brew/npm 混裝 | 統一入口後重裝 |
401/token |
設定與代理 header | 重跑 onboard;清殘留 |
| 靜默失敗 | 磁碟滿 | 日誌輪替;cache 指資料碟 |