1:需要安装git

C:\Users\Administrator>node -v
v22.22.1

出现这个错误,需要安装git

C:\Users\Administrator>npm install -g openclaw@latest
npm error code ENOENT
npm error syscall spawn git
npm error path git
npm error errno -4058
npm error enoent An unknown git error occurred
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache\_logs\2026-03-06T07_57_33_458Z-debug-0.log

2:安装git后

下载地址:https://git-scm.com/

C:\Users\Administrator>git --version
git version 2.53.0.windows.1

3:安装npm install -g openclaw@latest

查看版本openclaw --version

C:\Users\Administrator>git --version
git version 2.53.0.windows.1

C:\Users\Administrator>npm install -g openclaw@latest
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated gauge@3.0.2: This package is no longer supported.

added 693 packages in 7m

C:\Users\Administrator>openclaw --version
2026.3.2

4:初始化配置


C:\Users\Administrator>openclaw onboard --install-daemon

🦞 OpenClaw  2026.3.2 (85377a2) — Your .zshrc wishes it could do what I do.

Windows detected — OpenClaw runs great on WSL2!
Native Windows might be trickier.
Quick setup: wsl --install (one command, one reboot)
Guide: https://docs.openclaw.ai/windows
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██
██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██
██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                  🦞 OPENCLAW 🦞

T  OpenClaw onboarding
|
o  Security ---------------------------------------------------------------------------------+
|                                                                                            |
|  Security warning — please read.                                                           |
|                                                                                            |
|  OpenClaw is a hobby project and still in beta. Expect sharp edges.                        |
|  By default, OpenClaw is a personal agent: one trusted operator boundary.                  |
|  This bot can read files and run actions if tools are enabled.                             |
|  A bad prompt can trick it into doing unsafe things.                                       |
|                                                                                            |
|  OpenClaw is not a hostile multi-tenant boundary by default.                               |
|  If multiple users can message one tool-enabled agent, they share that delegated tool      |
|  authority.                                                                                |
|                                                                                            |
|  If you’re not comfortable with security hardening and access control, don’t run           |
|  OpenClaw.                                                                                 |
|  Ask someone experienced to help before enabling tools or exposing it to the internet.     |
|                                                                                            |
|  Recommended baseline:                                                                     |
|  - Pairing/allowlists + mention gating.                                                    |
|  - Multi-user/shared inbox: split trust boundaries (separate gateway/credentials, ideally  |
|    separate OS users/hosts).                                                               |
|  - Sandbox + least-privilege tools.                                                        |
|  - Shared inboxes: isolate DM sessions (`session.dmScope: per-channel-peer`) and keep      |
|    tool access minimal.                                                                    |
|  - Keep secrets out of the agent’s reachable filesystem.                                   |
|  - Use the strongest available model for any bot with tools or untrusted inboxes.          |
|                                                                                            |
|  Run regularly:                                                                            |
|  openclaw security audit --deep                                                            |
|  openclaw security audit --fix                                                             |
|                                                                                            |
|  Must read: https://docs.openclaw.ai/gateway/security                                      |
|                                                                                            |
+--------------------------------------------------------------------------------------------+
|
*  I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
|    Yes / > No
o  I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
|  Yes
|
*  Onboarding mode
|    QuickStart
|  > Manual (Configure port, network, Tailscale, and auth options.)
*  What do you want to set up?
|  > Local gateway (this machine) (No gateway detected (ws://127.0.0.1:18789))
|    Remote gateway (info-only)
*  Workspace directory
|  C:\Users\Administrator\.openclaw\workspace
*  Model/auth provider
|  > OpenAI (Codex OAuth + API key)
|    Anthropic
|    Chutes
|    vLLM
|    MiniMax
|    Moonshot AI (Kimi K2.5)
|    Google
|    xAI (Grok)
|    Mistral AI
|    Volcano Engine
|    BytePlus
|    OpenRouter
|    Kilo Gateway
|    Qwen
|    Z.AI
|    Qianfan
|    Copilot
|    Vercel AI Gateway
|    OpenCode Zen
|    Xiaomi
|    Synthetic
|    Together AI
|    Hugging Face
|    Venice AI
|    LiteLLM
|    Cloudflare AI Gateway
|    Custom Provider
|    Skip for now
—

选择好模型

+--------------------------------------------------------------------------------------------+
|
o  I understand this is personal-by-default and shared/multi-user use requires lock-down. Continue?
|  Yes
|
o  Onboarding mode
|  Manual
|
o  What do you want to set up?
|  Local gateway (this machine)
|
o  Workspace directory
|  H:\openclaw\workspace
|
o  Model/auth provider
|  Qwen
|
•  Starting Qwen OAuth…|
o  Qwen OAuth -------------------------------------------------------------------------+
|                                                                                      |
|  Open https://chat.qwen.ai/authorize?user_code=Z7BYDI2J&client=qwen-code to approve  |
|  access.                                                                             |
|  If prompted, enter the code Z7BYDI2J.                                               |
|                                                                                      |
+--------------------------------------------------------------------------------------+
o  Qwen OAuth complete
|
o  Model configured -----------------------------+
|                                                |
|  Default model set to qwen-portal/coder-model  |
|                                                |
+------------------------------------------------+
|
o  Provider notes ----------------------------------------------------------------------+
|                                                                                       |
|  Qwen OAuth tokens auto-refresh. Re-run login if refresh fails or access is revoked.  |
|  Base URL defaults to https://portal.qwen.ai/v1. Override                             |
|  models.providers.qwen-portal.baseUrl if needed.                                      |
|                                                                                       |
+---------------------------------------------------------------------------------------+
|
o  Default model
|  Keep current (qwen-portal/coder-model)
|
o  Gateway port
|  18789
|
*  Gateway bind
|  > Loopback (127.0.0.1)
|    LAN (0.0.0.0)
|    Tailnet (Tailscale IP)
|    Auto (Loopback → LAN)
|    Custom IP

下一步
 Gateway token (blank to generate)
|   Needed for multi-machine or non-loopback access

  Gateway bind
|  Loopback (127.0.0.1)
|
o  Gateway auth
|  Token
|
o  Tailscale exposure
|  Off
|
o  Gateway token (blank to generate)
|
|
o  Channel status ----------------------------+
|                                             |
|  Telegram: needs token                      |
|  WhatsApp (default): not linked             |
|  Discord: needs token                       |
|  Slack: needs tokens                        |
|  Signal: needs setup                        |
|  signal-cli: missing (signal-cli)           |
|  iMessage: needs setup                      |
|  imsg: missing (imsg)                       |
|  IRC: not configured                        |
|  Google Chat: not configured                |
|  Feishu: install plugin to enable           |
|  Google Chat: install plugin to enable      |
|  Nostr: install plugin to enable            |
|  Microsoft Teams: install plugin to enable  |
|  Mattermost: install plugin to enable       |
|  Nextcloud Talk: install plugin to enable   |
|  Matrix: install plugin to enable           |
|  BlueBubbles: install plugin to enable      |
|  LINE: install plugin to enable             |
|  Zalo: install plugin to enable             |
|  Zalo Personal: install plugin to enable    |
|  Synology Chat: install plugin to enable    |
|  Tlon: install plugin to enable             |
|                                             |
+---------------------------------------------+
|
*  Configure chat channels now?
|  > Yes /   No

不配置

o  Configure chat channels now?
|  No
Updated ~\.openclaw\openclaw.json
Workspace OK: H:\openclaw\workspace
Sessions OK: ~\.openclaw\agents\main\sessions
|
o  Skills status -------------+
|                             |
|  Eligible: 3                |
|  Missing requirements: 40   |
|  Unsupported on this OS: 8  |
|  Blocked by allowlist: 0    |
|                             |
+-----------------------------+
|
*  Configure skills now? (recommended)
|  > Yes /   No

o  Configure skills now? (recommended)
|  Yes
|
*  Install missing skill dependencies 
|  [•] Skip for now (Continue without installing dependencies)
|  [ ] 🔐 1password
|  [ ] 📰 blogwatcher
|  [ ] 🫐 blucli
|  [ ] 📸 camsnap
|  [ ] 🧩 clawhub
|  [ ] 🎛️ eightctl
|  [ ] ♊️ gemini
|  [ ] 🧲 gifgrep
|  [ ] 🐙 github
|  [ ] 🎮 gog
|  [ ] 📍 goplaces
|  [ ] 📧 himalaya
|  [ ] 📦 mcporter
|  [ ] 🍌 nano-banana-pro
|  [ ] 📄 nano-pdf
|  [ ] 💎 obsidian
|  [ ] 🎙️ openai-whisper
|  [ ] 💡 openhue
|  [ ] 🧿 oracle
|  [ ] 🛵 ordercli
|  [ ] 🗣️ sag
|  [ ] 🌊 songsee
|  [ ] 🔊 sonoscli
|  [ ] 🧾 summarize
|  [ ] 🎞️ video-frames
|  [ ] 📱 wacli
|  [ ] 𝕏 xurl

 Please select at least one option.
   Press  space  to select,  enter  to submit

o  Configure skills now? (recommended)
|  Yes
|
o  Install missing skill dependencies
|  Skip for now
|
o  Set GOOGLE_PLACES_API_KEY for goplaces?
|  No
|
o  Set GEMINI_API_KEY for nano-banana-pro?
|  No
|
o  Set NOTION_API_KEY for notion?
|  No
|
o  Set OPENAI_API_KEY for openai-image-gen?
|  No
|
o  Set OPENAI_API_KEY for openai-whisper-api?
|  No
|
o  Set ELEVENLABS_API_KEY for sag?
|  No
|
o  Hooks ------------------------------------------------------------------+
|                                                                          |
|  Hooks let you automate actions when agent commands are issued.          |
|  Example: Save session context to memory when you issue /new or /reset.  |
|                                                                          |
|  Learn more: https://docs.openclaw.ai/automation/hooks                   |
|                                                                          |
+--------------------------------------------------------------------------+
|
*  Enable hooks?
|  [•] Skip for now
|  [ ] 🚀 boot-md
|  [ ] 📎 bootstrap-extra-files
|  [ ] 📝 command-logger
|  [ ] 💾 session-memory

选择跳过

o  Enable hooks?
|  Skip for now
Config overwrite: C:\Users\Administrator\.openclaw\openclaw.json (sha256 fbc859b2f1757df092ece4829ec9718111531d03d7a54410608e6cf6966ed141 -> 8b9942b04705644bd8562d1ab585b9263dc678cce8c9a88191dffd23fe5bfe33, backup=C:\Users\Administrator\.openclaw\openclaw.json.bak)
|
*  Gateway service runtime
|  > Node (recommended) (Required for WhatsApp + Telegram. Bun can corrupt memory on reconnect.)

选择node,安装服务

o  Gateway service runtime
|  Node (recommended)
|
0  Installing Gateway service…
Installed Scheduled Task: OpenClaw Gateway
Task script: C:\Users\Administrator\.openclaw\gateway.cmd
o  Gateway service installed.
|
o
Agents: main (default)
Heartbeat interval: 30m (main)
Session store (main): C:\Users\Administrator\.openclaw\agents\main\sessions\sessions.json (0 entries)
|
o  Optional apps ------------------------+
|                                        |
|  Add nodes for extra features:         |
|  - macOS app (system + notifications)  |
|  - iOS app (camera/canvas)             |
|  - Android app (camera/canvas)         |
|                                        |
+----------------------------------------+
|
o  Control UI ---------------------------------------------------------------------+
|                                                                                  |
|  Web UI: http://127.0.0.1:18789/                                                 |
|  Web UI (with token):                                                            |
|  http://127.0.0.1:18789/#token=d302cd29cc6190e4d4502ca81836205cc5c4934ddcc94264  |
|  Gateway WS: ws://127.0.0.1:18789                                                |
|  Gateway: reachable                                                              |
|  Docs: https://docs.openclaw.ai/web/control-ui                                   |
|                                                                                  |
+----------------------------------------------------------------------------------+
|
o  Start TUI (best option!) ---------------------------------+
|                                                            |
|  This is the defining action that makes your agent you.    |
|  Please take your time.                                    |
|  The more you tell it, the better the experience will be.  |
|  We will send: "Wake up, my friend!"                       |
|                                                            |
+------------------------------------------------------------+
|
o  Token ---------------------------------------------------------------------------------+
|                                                                                         |
|  Gateway token: shared auth for the Gateway + Control UI.                               |
|  Stored in: ~/.openclaw/openclaw.json (gateway.auth.token) or OPENCLAW_GATEWAY_TOKEN.   |
|  View token: openclaw config get gateway.auth.token                                     |
|  Generate token: openclaw doctor --generate-gateway-token                               |
|  Web UI stores a copy in this browser's localStorage (openclaw.control.settings.v1).    |
|  Open the dashboard anytime: openclaw dashboard --no-open                               |
|  If prompted: paste the token into Control UI settings (or use the tokenized dashboard  |
|  URL).                                                                                  |
|                                                                                         |
+-----------------------------------------------------------------------------------------+
|
*  How do you want to hatch your bot?
|  > Hatch in TUI (recommended)
|    Open the Web UI
|    Do this later

选择open the web UIxuanddd

o  How do you want to hatch your bot?
|  Open the Web UI
|
o  Dashboard ready ----------------------------------------------------------------+
|                                                                                  |
|  Dashboard link (with token):                                                    |
|  http://127.0.0.1:18789/#token=d302cd29cc6190e4d4502ca81836205cc5c4934ddcc94264  |
|  Opened in your browser. Keep that tab to control OpenClaw.                      |
|                                                                                  |
+----------------------------------------------------------------------------------+
|
o  Workspace backup ----------------------------------------+
|                                                           |
|  Back up your agent workspace.                            |
|  Docs: https://docs.openclaw.ai/concepts/agent-workspace  |
|                                                           |
+-----------------------------------------------------------+
|
o  Security ------------------------------------------------------+
|                                                                 |
|  Running agents on your computer is risky — harden your setup:  |
|  https://docs.openclaw.ai/security                              |
|                                                                 |
+-----------------------------------------------------------------+
|
*  Enable zsh shell completion for openclaw?
|  > Yes /   No

选择Yes,完成

  Shell completion -------------------------------------------------------+
|                                                                          |
|  Shell completion installed. Restart your shell or run: source ~/.zshrc  |
|                                                                          |
+--------------------------------------------------------------------------+
|
o  Web search (optional) -----------------------------------------------------------------+
|                                                                                         |
|  If you want your agent to be able to search the web, you’ll need an API key.           |
|                                                                                         |
|  OpenClaw uses Brave Search for the `web_search` tool. Without a Brave Search API key,  |
|  web search won’t work.                                                                 |
|                                                                                         |
|  Set it up interactively:                                                               |
|  - Run: openclaw configure --section web                                                |
|  - Enable web_search and paste your Brave Search API key                                |
|                                                                                         |
|  Alternative: set BRAVE_API_KEY in the Gateway environment (no config changes).         |
|  Docs: https://docs.openclaw.ai/tools/web                                               |
|                                                                                         |
+-----------------------------------------------------------------------------------------+
|
o  What now -------------------------------------------------------------+
|                                                                        |
|  What now: https://openclaw.ai/showcase ("What People Are Building").  |
|                                                                        |
+------------------------------------------------------------------------+
|
—  Onboarding complete. Dashboard opened; keep that tab to control OpenClaw.

5:运行

https://docs.openclaw.ai/zh-CN/gateway

openclaw gateway --port 18789
# 在 stdio 中获取完整的调试/追踪日志:
openclaw gateway --port 18789 --verbose
# 如果端口被占用,终止监听器然后启动:
openclaw gateway --force
# 开发循环(TS 更改时自动重载):
pnpm gateway:watch

Logo

小龙虾开发者社区是 CSDN 旗下专注 OpenClaw 生态的官方阵地,聚焦技能开发、插件实践与部署教程,为开发者提供可直接落地的方案、工具与交流平台,助力高效构建与落地 AI 应用

更多推荐