npm离线安装包

先在联网机器安装node

设置好缓存目录

设置国内镜像npm config set registry https://registry.npmmirror.com
命令npm config set cache "C:\Users\ch\.npm"

直接下载好项目

设置https替换ssh

git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf ssh://
git config --global url."https://".insteadOf git://

命令npm install -g openclaw@latest --prefer-offline

openclaw的安装条件,前提

  1. 必须安装的依赖
    OpenClaw 是 Node.js-based 的 CLI 工具,因此需要:

Node.js ≥ 22.12.0
下载地址:nodejs.org
勾选 “Add to PATH”。

VS Build Tool(必须)
解决 node-gyp / llama.cpp 编译失败的核心:
必须安装 Microsoft Visual Studio Build Tools + Desktop C++ workload。

下载:
https://visualstudio.microsoft.com/visual-cpp-build-tools/

安装时勾选:

Desktop development with C++

Windows SDK(默认)

posted @ 2026-03-01 22:59  竹石2020  阅读(35)  评论(0)    收藏  举报