本来以为安装个Openclaw还不是手到擒来;结果从安装到用起来花了我一天时间。问Claude ops4.6、Claude sonnet4.6 、Gemini3.1pro和GPT5.4,给的教程或者问题解决方案,好多都是错的。真的是没学会的知识,大模型的回答质量很差。
我重装了电脑系统和brew的core配置。
- mac(Intel)
- macOS 14.8
- Homebrew 5.0.16
- Node js v22.16.0(必须22以上)
- git version 2.23.0
- npm 10.9.2
不一定需要跟我环境一样,相似的配置M系列的芯片应该也是可以的。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # 配置 brew 加入 PATH echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" # 检查是否安装好 brew -v
有踩坑的点如下:
# 踩坑 (下面看个人情况需要) brew tap #没有输出,理想输出:homebrew/core brew tap homebrew/core --force # 需要从git安装,如果速度太慢可以使用国内镜像源安装 # 镜像源配置 git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git brew update
brew install node@22 # 踩坑 (下面看个人情况需要) 如果电脑上面有其他版本,它默认指向其他版本比如v20 brew unlink node brew link --overwrite --force node@22 # 查看版本 理想输出:v22.xx.x node -v
# 这是官网的安装命令,中途可能会遇到一些错误就需要自己解决了,有可能文件权限问题等 curl -fsSL https://openclaw.ai/install.sh | bash # 验证安装好了 openclaw --version # 理想输出:OpenClaw 2026.3.8 (3caab92)

# 启动服务 openclaw gateway # 再开一个终端,这里就会自动跳转到网页了 openclaw dashboard

# 这里踩坑非常久,以为是API配不对,其实是openclaw的网关服务有问题,不知道是没有安装还是错误的 openclaw gateway restart
如果出现下面错误说明你的网关也有问题

# 安装一下网关 openclaw gateway install --force # 安装好检查一下 openclaw gateway status
先去deepseek API 官网 注册账号,充钱。创建一下自己的API KEY

配置mac电脑的配置文件,路径是:/Users/linxiaohai(你自己的用户用)/.openclaw/openclaw.json;下面是我的完整的,参考看;
{ "meta": { "lastTouchedVersion": "2026.3.8", "lastTouchedAt": "2026-03-11T06:31:03.045Z" }, "wizard": { "lastRunAt": "2026-03-11T03:46:42.414Z", "lastRunVersion": "2026.3.8", "lastRunCommand": "onboard", "lastRunMode": "local" }, "auth": { "profiles": { "openai:default": { "provider": "openai", "mode": "api_key" } } }, "models": { "providers": { "deepseek": { "baseUrl": "https://api.deepseek.com", "apiKey": "sk-xxxxxxxxxx(你自己的API key上面刚刚创建的)", "api": "openai-completions", "models": [ { "id": "deepseek-chat", "name": "DeepSeek Chat (V3)", "reasoning": false, "input": ["text"], "contextWindow": , "maxTokens": 8192 }, { "id": "deepseek-reasoner", "name": "DeepSeek Reasoner (R1)" } ] } } }, "agents": { "defaults": { "model": { "primary": "deepseek/deepseek-chat" }, "models": { "deepseek/deepseek-chat": { "alias": "DeepSeek Chat" } }, "workspace": "/Users/linxiaohai/.openclaw/workspace", "compaction": { "mode": "safeguard" }, "maxConcurrent": 4, "subagents": { "maxConcurrent": 8 } } }, "tools": { "profile": "full" }, "messages": { "ackReactionScope": "group-mentions" }, "commands": { "native": "auto", "nativeSkills": "auto", "restart": true, "ownerDisplay": "raw" }, "session": { "dmScope": "per-channel-peer" }, "gateway": { "port": 18789, "mode": "local", "bind": "loopback", "auth": { "mode": "token", "token": "6f8a4b5fa9c7c1eeb8a3617d85b3a0d3377b33b7c9defc32" }, "tailscale": { "mode": "off", "resetOnExit": false } } }
你需要改的只有下面2处,其他的你电脑里面原来文件就有;


# 后台启动的 openclaw gateway restart # 下面看日志 tail -f ~/.openclaw/logs/gateway.log # 关闭 openclaw gateway stop # 或者直接启动,日志直接打印 openclaw gateway # 启动网页 openclaw dashboard

其实还有很多坑,我感觉只跟我自己电脑环境有关系,就没有写出来了,有的话,可以评论区讨论!装了一整天,真的累了。
https://docs.openclaw.ai/ 这是官方文档,有需要可以自己看看。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/283496.html原文链接:https://javaforall.net
