一、npm安装 (如果不知道是否安装,可以用下面的命令查看自己的版本) npm -v 二、node.js安装 (注意:版本必须是22.00以上,可以检查自己的版本) node -v 三、安装openclaw 1、先卸载旧版(如有): npm uninstall -g openclaw 2、命令安装: sudo npm i -g openclaw 输入完
如果你不确定是否已经安装了npm,不妨先用这个命令查一下当前版本:
npm -v
长期稳定更新的攒劲资源: >>>点此立即查看<<<
这里有个关键点:node.js版本必须达到22.00以上。安装前最好先确认下现有版本:
node -v
npm uninstall -g openclaw
sudo npm i -g openclaw
执行这个命令后,系统会提示输入密码。注意输入时密码不会显示,直接输完按回车就行。
成功安装后会看到一系列提示信息:
npm warn deprecated npmlog@6.0.2: This package is no longer supported.
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@3.0.1: This package is no longer supported.
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated gauge@3.0.2: This package is no longer supported.
npm warn deprecated gauge@4.0.4: This package is no longer supported.
npm warn deprecated tar@6.2.1: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated tar@6.2.1: Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
npm warn deprecated glob@10.5.0: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated glob@7.2.3: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
added 711 packages in 4m
130 packages are looking for funding
run `npm fund` for details

注意事项:可能出现的两种错误
1、输入:npm uninstall -g openclaw,出现如图错误:
npm error code 128
npm error An unknown git error occurred
npm error command git --no-replace-objects ls-remote ssh://git@github.com/whiskeysockets/libsignal-node.git
npm error fatal: unable to access 'https://github.com/whiskeysockets/libsignal-node.git/': Failed to connect to github.com port 443 after 75023 ms: Couldn't connect to server
npm error A complete log of this run can be found in: /Users/mac/.npm/_logs/2026-02-28T05_46_11_305Z-debug-0.log
解决方案,输入修改 Git 下载协议 (强制使用 HTTPS),复制下方代码到终端,回车执行即可解决;
git config --global url."https://github.com/".insteadOf ssh://git@github.com/再输入
sudo npm i -g openclaw2、输入:npm install -g openclaw-cn@latest,出现如图错误,因为没有权限,需要用sudo
npm error code EACCES
npm error syscall mkdir
npm error path /usr/local/lib/node_modules/openclaw-cn
npm error errno -13
npm error Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/openclaw-cn'
npm error at async mkdir (node:internal/fs/promises:856:10)
npm error at async /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:576:20
npm error at async Promise.allSettled (index 0)
npm error at async [reifyPackages] (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:313:11)
npm error at async Arborist.reify (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:125:5)
npm error at async Install.exec (/usr/local/lib/node_modules/npm/lib/commands/install.js:150:5)
npm error at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:208:9)
npm error at async module.exports (/usr/local/lib/node_modules/npm/lib/cli/entry.js:67:5) {
npm error errno: -13,
npm error code: 'EACCES',
npm error syscall: 'mkdir',
npm error path: '/usr/local/lib/node_modules/openclaw-cn'
npm error }
npm error
npm error The operation was rejected by your operating system.
npm error It is likely you do not have the permissions to access this file as the current user
npm error
npm error If you believe this might be a permissions issue, please double-check the
npm error permissions of the file and its containing directories, or try running
npm error the command again as root/Administrator.
npm error A complete log of this run can be found in: /Users/mac/.npm/_logs/2026-02-28T05_25_31_926Z-debug-0.log
解决方案,没有权限,npm前面加上sudo
sudo npm i -g openclaw
openclaw --version

看到版本号显示出来,就说明安装成功了。
openclaw onboard
这一步主要是提醒你,使用 OpenClaw 可能会有一些风险。请问你是否继续?按向左方向键 ←,选择 Yes,按 Enter 回车确认
选择 QiuickStart(快速开始模式),回车

这里需要配置 AI 模型的 API Key,毕竟 OpenClaw 得连接到大型语言模型才能正常工作。考虑到 OpenClaw 比较消耗 token,国外模型的成本偏高,个人建议选择千问这类国内模型;


这一步其实可以「暂时跳过」,直接选到最后面的 skip for now。先在终端里把 OpenClaw 运行起来,确认它的 AI 功能和文件读写权限都正常,后续再单独部署聊天工具也不迟;

这里建议选择「Yes」,当然你也可以先选「No」跳过,后面通过UI界面再配置;

点击空格选择需要的技能,选完后回车。关于技能配置,你可以先跳过这一步,或者用空格键选择需要的技能,支持多选;

注意事项:如果出现 please select at least one option 提示
解决方案:点击空格选择至少一个技能,然后回车。
这里可以配置备用 API,如果暂时不需要就都选「No」;


系统正在完成最后的启动配置,这个过程大概需要30秒左右;

我这个是页面启动失败,可以在浏览器输入:http://127.0.0.1:18789
注意事项:
打开 http://127.0.0.1:18789 链接出现 unauthorized: gateway token mismatch (open the dashboard URL and paste the token in Control UI settings 错误;
解决办法:
1、先找到 openclaw.json 文件;
2、找到 gateway>auth>token,复制 token 值;
3、在概览的“网关令牌”添加令牌值,就是上面复制的值;
4、重启网关;
openclaw gateway restart
5、打开:http://127.0.0.1:18789/token=这是令牌值 即可,比如令牌是abc123,那打开链接就是 http://127.0.0.1:18789/token=abc123
侠游戏发布此文仅为了传递信息,不代表侠游戏网站认同其观点或证实其描述