全程干货无废话。
首先要下载git和node.js两个软件才能确保龙虾的正常安装。
一、Git 安装与卸载(含下载地址)
官方下载地址
- 官网:https://git-scm.com/downloads
- Windows 直链:https://gitscm.com/download/win
- macOS 直链:https://gitscm.com/download/mac
Windows 安装
1. 下载 .exe 安装包
2. 双击安装,一路默认 Next
- 可勾选 Git Bash Here(右键快捷)
- 推荐默认编辑器选 VS Code
3. 验证(CMD/PowerShell):
bash git --version
Windows 卸载
1. 控制面板 → 程序 → 卸载程序 → 找到 Git → 卸载
2. 清理残留(可选):
bash
rmdir /s /q C:\Program Files\Git
rmdir /s /q %USERPROFILE%\.gitconfig
macOS 安装(2种)
方法1:Homebrew(推荐)
bash
brew install git
方法2:官方 .pkg 安装包
下载后双击安装,一路默认
验证:
bash
git --version
macOS 卸载
方法1:Homebrew
bash
brew uninstall git
方法2:手动卸载
bash
sudo rm -rf /usr/local/git
sudo rm /etc/paths.d/git
sudo rm /etc/manpaths.d/git
rm -rf ~/.gitconfig
二、Node.js + npm 安装与卸载(含下载地址)
官方下载地址
中文官网:https://nodejs.org/zh-cn/
- 下载页:https://nodejs.org/zh-cn/download/
- Windows: .msi 64位 LTS 版
- macOS: .pkg LTS 版
Windows 安装
1. 下载 .msi
2. 双击安装,务必勾选:Add to PATH
3. 验证(重启终端):
bash
node -v
npm -v
Windows 卸载
1. 控制面板 → 卸载程序 → 卸载 Node.js
2. 清理残留(可选):
bash
rmdir /s /q C:\Program Files\nodejs
rmdir /s /q %APPDATA%\npm
rmdir /s /q %USERPROFILE%\.npmrc
macOS 安装(2种)
方法1:Homebrew(推荐)
bash
brew install node
方法2:官方 .pkg
下载双击安装,默认即可
验证:
bash
node -v
npm -v
macOS 卸载
方法1:Homebrew
bash
brew uninstall node
方法2:手动卸载
bash
sudo rm -rf /usr/local/{bin/{node,npm},include/node,lib/node_modules,share/man/*/node*}
rm -rf ~/.npm ~/.node-gyp
三、OpenClaw npm 安装与卸载(Windows + Mac)
安装(全局)bash
npm install -g openclaw
验证:bash
openclaw --version
openclaw doctor
卸载(彻底)
1. 先执行内置卸载(清服务/配置)bash
openclaw uninstall --all --yes
2. 再卸载 npm 包bash
npm uninstall -g openclaw
3. 清理残留
- Windows:
bash
Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw"
- macOS:
bash
rm -rf ~/.openclaw
四、一键验证(全部)bash
git --version
node -v
npm -v
openclaw --version
全部显示版本号 → 安装成功
提示“不是内部命令”或“command not found” → 已卸载
夜雨聆风