← Back to Skills Marketplace
paudyyin

node-llama-cpp 安装指南

by paudyyin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
53
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install node-llama-cpp-install-guide
Description
提供在美的内网环境下安装和排查 node-llama-cpp 以支持 OpenClaw memorySearch 的详细步骤和替代远程 embedding 配置。
README (SKILL.md)

node-llama-cpp 安装指南(Windows 内网环境)

概述

在美的集团内网环境下,为 OpenClaw memorySearch 安装 node-llama-cpp 的完整记录。包含 7 个常见问题的排查和替代方案(远程 embedding)。

环境要求

项目
OS Windows 10+ (x64)
Node >= 22.16.0(必须,低于此版本会导致 DLL 加载失败)
npm >= 10.9.0
OpenClaw 2026.3.13+
网络 GitHub HTTPS 可用,SSH 可能被内网封锁

核心问题清单

问题 1:GitHub SSH 被封锁

ssh: connect to host github.com port 22: Connection timed out

修复

git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf ssh://[email protected]/

问题 2:npm 依赖冲突

npm error ERESOLVE could not resolve
npm error peerOptional oxlint-tsgolint@">=0.22.1" from [email protected]

修复:使用 --force--legacy-peer-deps

问题 3:Node 版本不匹配

npm warn EBADENGINE Unsupported engine {
  required: { node: '>=22.16.0' },
  current: { node: 'v22.14.0' }
}

影响:Node 22.14.0 与预编译二进制 ABI 不兼容,导致 ERR_DLOPEN_FAILED

修复:升级 Node 到 22.16+ 或更高。

问题 4:预编译二进制 DLL 加载失败

Error: A dynamic link library (DLL) initialization routine failed.
code: 'ERR_DLOPEN_FAILED'

根因:Node 版本不匹配。

问题 5:postinstall 下载失败

request to https://github.com/xpack-dev-tools/cmake-xpack/releases/... failed
reason: connect ETIMEDOUT

根因:内网封锁 GitHub Releases 下载。

问题 6:源码编译失败

SpawnError: Command npm exec --yes -- xpm@^0.16.3 install @xpack-dev-tools/cmake@latest exited with code 3

根因:cmake 无法下载。

问题 7:预编译二进制本地缺失

workspace 中 node-llama-cpp 的 bins 目录只有 .moved.txt 占位符,真实二进制被清理。

安装步骤(如果网络畅通)

cd "C:\Program Files\mx\resources\openclaw"
npm install node-llama-cpp --ignore-scripts --force
cd node_modules/node-llama-cpp
node ./dist/cli/cli.js postinstall

关键参数:

  • --ignore-scripts:绕过 git 依赖问题
  • --force:绕过 peer 依赖冲突

替代方案:远程 embedding(推荐用于内网环境)

openclaw.json 中配置:

{
  "agents": {
    "defaults": {
      "memorySearch": {
        "enabled": true,
        "sources": ["memory"],
        "provider": "openai",
        "remote": {
          "baseUrl": "https://apiprod.midea.com/llm/f-devops-python-litellm/v1",
          "apiKey": ""
        },
        "fallback": "none"
      }
    }
  }
}

验证

openclaw.cmd memory status

预期输出:

Provider: openai (requested: openai)
Model: text-embedding-3-small
Vector: ready
FTS: ready

三层防护配置(防止配置丢失)

第 1 层:PRD preset

C:\Program Files\mx\resources\openclaw\config\prd-openclaw.json

加入 memorySearch 和 plugins 配置。

第 2 层:openclaw.cmd 环境变量

D:\Users\yindb2\AppData\Local\openclaw\mx\current\openclaw.cmd

添加:

set "OPENCLAW_CONFIG_MODE=local"
set "OPENCLAW_CONFIG_SERVER_TOKEN="

第 3 层:dist JS 白名单

C:\Program Files\mx\resources\openclaw\dist\reply-*.js

移除 agents.defaults 白名单。

教训

  1. 内网环境不要选本地嵌入方案:GitHub 封锁 + 网络限制导致安装不可行
  2. Node 版本必须匹配:22.14 vs 22.16 的差异足以导致 native addon 加载失败
  3. 远程 embedding 是最佳选择:配置即生效,不需要额外依赖
  4. PRD preset 必须同步更新:否则 gateway 重启后配置被覆盖

参考

  • node-llama-cpp 文档:https://node-llama-cpp.withcat.ai
  • OpenClaw memorySearch:https://docs.openclaw.ai/reference/memory-config
Usage Guidance
Review this before installing in a managed OpenClaw environment. Use supported OpenClaw configuration mechanisms where possible, get approval before routing memorySearch to the remote embedding endpoint, and do not remove whitelists or edit Program Files/dist artifacts unless you have a documented rollback plan and understand the support and security impact.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The stated purpose is coherent with installing node-llama-cpp and configuring memorySearch, but the guide goes beyond ordinary setup by recommending changes to OpenClaw presets, launcher environment variables, and compiled distribution JavaScript.
Instruction Scope
The instructions include removing an agents.defaults whitelist from dist JS and changing files under Program Files, which is a high-impact application behavior change with unclear boundaries.
Install Mechanism
There is no executable payload in the skill itself; it is a Markdown guide plus package metadata. The guide instructs users to run npm installation and postinstall commands inside an installed OpenClaw directory.
Credentials
The Windows enterprise environment and memorySearch purpose explain the remote embedding configuration, but the guide does not clearly warn that memory content or derived embedding inputs may be sent to the configured remote API.
Persistence & Privilege
The guide recommends persistent local changes to PRD preset files, a launcher command file, and compiled JS, with no clear backup, rollback, support-impact, or approval instructions.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install node-llama-cpp-install-guide
  3. After installation, invoke the skill by name or use /node-llama-cpp-install-guide
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
首次发布:Windows 内网环境完整安装记录 + 7 个问题排查 + 远程 embedding 替代方案
Metadata
Slug node-llama-cpp-install-guide
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is node-llama-cpp 安装指南?

提供在美的内网环境下安装和排查 node-llama-cpp 以支持 OpenClaw memorySearch 的详细步骤和替代远程 embedding 配置。 It is an AI Agent Skill for Claude Code / OpenClaw, with 53 downloads so far.

How do I install node-llama-cpp 安装指南?

Run "/install node-llama-cpp-install-guide" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is node-llama-cpp 安装指南 free?

Yes, node-llama-cpp 安装指南 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does node-llama-cpp 安装指南 support?

node-llama-cpp 安装指南 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created node-llama-cpp 安装指南?

It is built and maintained by paudyyin (@paudyyin); the current version is v1.0.0.

💬 Comments