# 解决方案:清理缓存并重试
# 1. 清理npm缓存
npm cache clean --force
# 2. 删除node_modules
rm -rf node_modules
# 3. 使用国内镜像(如果在中国)
npm config set registry https://registry.npmmirror.com
# 4. 重新安装
npm install --legacy-peer-deps
5.2 运行问题
问题:端口被占用
# 检查端口占用
# Linux/macOS
lsof -i :3000
lsof -i :18789
# Windows
netstat -ano | findstr :3000
# 解决方案:修改端口
openclaw config set gateway.port 3001
openclaw config set ui.port 3002
openclaw gateway restart
问题:Gateway服务无法启动
# 查看错误日志
openclaw gateway logs
# 重置配置
openclaw config reset
# 重新运行onboarding
openclaw onboard
# 手动启动Gateway
openclaw gateway start --verbose
🎯 第六章:下一步学习
6.1 基础功能体验
# 1. 与AI助手聊天
openclaw chat "你好,介绍一下你自己"
# 2. 查看可用命令
openclaw --help
# 3. 查看插件列表
openclaw plugins list
# 4. 查看技能列表
openclaw skills list
6.2 安装第一个插件
# 安装天气插件
npm install @openclaw/skill-weather
# 启用插件
openclaw plugins enable weather
# 测试插件
openclaw chat "今天北京的天气怎么样"
6.3 配置AI模型
# 查看当前模型配置
openclaw config get model
# 切换模型
openclaw config set model anthropic-claude-3
# 设置API密钥
openclaw config set anthropic.api_key "你的API密钥"
# 测试新模型
openclaw chat "用新模型回答:什么是机器学习"
📚 第七章:学习资源
7.1 官方文档
- OpenClaw官方文档:https://docs.openclaw.ai
- GitHub仓库:https://github.com/openclaw/openclaw
- API参考:https://docs.openclaw.ai/api
- 插件开发指南:https://docs.openclaw.ai/plugins
7.2 视频教程
- 官方入门视频:https://www.youtube.com/@openclaw
- 中文教程:B站搜索"OpenClaw教程"
- 实战项目:GitHub Examples仓库
7.3 社区支持
- Discord社区:https://discord.gg/clawd
- GitHub Issues:问题反馈和讨论
- Stack Overflow:技术问题解答
🎉 第八章:总结
🎯 安装完成检查清单
- ✅ Node.js已安装并验证
- ✅ OpenClaw CLI可用
- ✅ Gateway服务正常运行
- ✅ Web控制面板可访问
- ✅ 可以与AI助手对话
- ✅ 了解基本故障排除方法
8.1 你已经学会的技能
- 📦 安装和配置开发环境
- 🚀 使用一键脚本安装OpenClaw
- 🔧 运行onboarding向导完成配置
- 🔍 验证安装状态和排查问题
- 🌐 访问Web控制面板管理AI助手
- 🛠️ 安装插件扩展功能
8.2 后续学习路径
路径一:深度使用
- 学习高级配置选项
- 探索所有内置功能
- 开发工作流自动化
路径二:开发扩展
- 学习插件开发
- 创建自定义技能
- 贡献代码到开源项目
路径三:生产部署
- 学习Docker容器化
- 配置多用户系统
- 实现高可用部署
💡 温馨提示:
- 遇到问题先查看日志:
openclaw gateway logs - 定期更新:
npm update -g openclaw - 备份配置:
openclaw config backup - 加入社区获取帮助
教程信息:
- 版本:OpenClaw 1.0.0
- 更新时间:2024年3月
- 适用:macOS / Linux / Windows (WSL2)
- 作者:AI教程创作助手