Mac如何安装openclaw

一、npm安装

(如果不知道是否安装,可以用下面的命令查看自己的版本)

npm -v

二、node.js安装

(注意:版本必须是22.00以上,可以检查自己的版本)

node -v

三、安装openclaw

1、先卸载旧版(如有):

npm uninstall -g openclaw

2、命令安装:

sudo npm i -g openclaw 

输入完后,会让你输入自己的密码(密码是不显示的,直接输入然后回车即可)。

成功安装提示:

npm warn deprecated [email protected]: This package is no longer supported.

npm warn deprecated [email protected]: 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 [email protected]: This package is no longer supported.

npm warn deprecated [email protected]: This package is no longer supported.

npm warn deprecated [email protected]: This package is no longer supported.

npm warn deprecated [email protected]: This package is no longer supported.

npm warn deprecated [email protected]: 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 [email protected]

npm warn deprecated [email protected]: 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 [email protected]

npm warn deprecated [email protected]: Use your platform's native DOMException instead

npm warn deprecated [email protected]: 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 [email protected]

npm warn deprecated [email protected]: This package is no longer supported.

npm warn deprecated [email protected]: 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 [email protected]

npm warn deprecated [email protected]: 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://[email protected]/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),复制下方代码到终端,回车执行即可解决;

再输入

2、输入: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

3、检查是否安装成功

openclaw --version

可以查看到版本号,即安装成功。

4、初始化向导

openclaw onboard 

这一步主要是提醒你,使用 OpenClaw 可能会有一些风险。请问你是否继续?按向左方向键 ←,选择 Yes,按 Enter 回车确认

5、快速开始

选择选择 QiuickStart(快速开始模式),回车

6、配置模型

这里是配置 AI 模型 API Key,OpenClaw 需要连接到大语言模型才能工作。Openclaw 比较费 token,国外模型成本较高,我选的千问;

7、默认模型选择

8、选择聊天工具

可以「暂时跳过」,选择到最后skip for now,先在终端(Terminal)里把 OpenClaw 跑起来,确认它的 AI 大脑、文件读写权限都正常工作,后面再单独部署;

9、选择技能

这里选择「Yes」,也可以暂不配置选择「No」,后面通过UI界面再进行配置;

10、技能选择

点击空格,选择技能后回车。关于技能,你可以先跳过选择此步骤,或者使用空格键您需要的技能,可多选;

注意事项:出现please select at least one option

解决方案:点击空格,选择技能后回车。

11、配置备用API

这里可以配置备用 API,如果不想配置就都选「No」即可;

12、配置hooks

13、启动服务

正在完成最后的启动服务配置,大约30秒左右;

14、安装成功

我这个是页面启动失败,可以在浏览器输入:http://127.0.0.1:18789 http://127.0.0.1:18789 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、重启网关;



5、打开:http://127.0.0.1:18789/?token=这是令牌值 即可,比如令牌是abc123,那打开链接就是http://127.0.0.1:18789/?token=abc123

Read more

飞书机器人通知:任务完成自动推送消息提醒用户查收结果

飞书机器人通知:任务完成自动推送消息提醒用户查收结果 在档案馆管理员老李的日常工作中,有一项重复而繁琐的任务——接收家属寄来的黑白老照片扫描件,手动上传到修复工具,等待几十分钟处理完成后,再逐一截图回复:“您的照片已修复,请查收。”这样的流程不仅效率低下,还容易因遗忘或延迟导致用户体验下降。直到他所在单位接入了一个新系统:照片一上传,AI自动修复着色,完成后飞书机器人立刻弹出一条带预览链接的消息:“【老照片修复完成】您提交的照片已成功上色!”整个过程无需人工干预。 这背后并非魔法,而是DDColor图像着色模型 + ComfyUI可视化工作流 + 飞书机器人自动化通知三者协同构建的一套“智能处理—状态感知—即时反馈”闭环系统的落地实践。这套方案正悄然改变着AI应用的传统交互模式。 从“无感运行”到“主动告知”:为什么需要自动化通知? 当前大多数AI图像处理系统仍停留在“执行即结束”的阶段。用户点击“开始”,然后盯着进度条猜测何时完成;或者干脆切换窗口去做别的事,结果忘了回来查看输出文件夹。这种被动式交互极大削弱了AI本应带来的便捷性。 更深层次的问题在于,当多个任务并行时,缺

By Ne0inhk

本地使用ComfyUI运行Stable Diffusion 3.5

本地使用 ComfyUI 运行 Stable Diffusion 3.5-FP8 你有没有试过用一张消费级显卡,在不到两分钟内生成一张细节拉满的 1024×1024 分辨率图像?现在,这已经不是幻想。随着 Stable Diffusion 3.5-FP8 的发布,开源文生图模型正式迈入“高效推理”时代——不仅画质不输原版,速度更快、显存更省,甚至能在 RTX 3060 上流畅跑起来。 而搭配 ComfyUI 这个高度模块化的前端工具,整个部署过程变得异常轻量且可控。本文将带你从零开始,一步步在本地搭建这套高性能量化系统,并避开国内用户最头疼的网络和路径问题。 硬件要求没你想的那么高 很多人一听到 SD3.5 就下意识觉得“得上专业卡”,其实那是针对未量化的大模型版本。FP8 版本通过 8-bit 浮点精度压缩,大幅降低了计算负载和内存占用。 实测表明:

By Ne0inhk
AI安全:视觉提示词注入攻击代码/实战教学| 针对Hugging Face开源大模型Stable Diffusion Model

AI安全:视觉提示词注入攻击代码/实战教学| 针对Hugging Face开源大模型Stable Diffusion Model

提到提示词注入(Prompt Injection),大家的第一反应往往是精心构造的文本越狱指令。 而在图生图任务中,输入图像在本质上扮演了视觉提示词的角色,与文本指令共同指导生成模型。 基于这一视角,本文展示针对视觉提示词的注入攻击:通过PGD对抗攻击算法对输入图像进行像素级微调,使其生成的违规图像能够绕过开源大模型的NSFW安全检测机制。 临近毕业,感觉市场对提示词注入比较感兴趣,因本人读博期间一直研究对抗攻击算法,所以决定尝试用对抗攻击的思路完成提示词注入攻击,误导开源模型生成违规图像。 完整代码链接:https://github.com/YujiangLi0v0/Injection_Attack_Inpainting.git 目录 * 一、 NSFW防线:开源模型的安全过滤机制 * 二、 攻击场景定义 (Threat Model) * 三、 环境搭建 * 四、 核心攻击流程详解 * 4.1. 固定随机因子 * 4.2 数据预处理 * 4.3. 攻击部分 * 4.3.1 重写扩散模型推理过程

By Ne0inhk

从零开始:Xilinx FPGA驱动USB3.0外设手把手教程

从零开始:Xilinx FPGA驱动USB3.0外设实战全解析 当你的FPGA需要“飙”5 Gbps——为什么是现在? 你有没有遇到过这样的场景: FPGA采集了一堆高速数据,比如1080p@60fps的图像流,或者雷达回波信号,结果发现传输到PC的速度成了瓶颈?用传统UART、SPI甚至USB2.0?抱歉,它们早就跟不上节奏了。 这时候, USB3.0 (SuperSpeed USB)就成了那个“破局者”。它理论带宽高达 5 Gbps (约500 MB/s),实际稳定传输可达 350~400 MB/s —— 这意味着你能以接近实时的速度把一整帧未压缩的高清图像“甩”给上位机。而这一切,只需要一根常见的USB线缆。 但问题来了:如何让Xilinx FPGA真正掌控这条高速通道?不是挂个芯片就完事,而是要从物理层开始,亲手打通整个链路。本文不讲空话,

By Ne0inhk