Node.js 环境
安装 Node.js LTS 并验证 node 和 npm 可用
Claude Code、Gemini CLI、Codex 等命令行工具都依赖 Node.js。建议安装 Node.js 20 或更高版本的 LTS。
安装
推荐直接前往 Node.js 官网 下载 LTS 安装包。也可以使用下面的包管理器方式:
choco install nodejs-ltsscoop install nodejs-ltsbrew install nodecurl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejscurl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum install -y nodejs验证安装
node --version
npm --version如果能输出版本号,就可以继续配置 Claude Code、Codex 或 Gemini CLI。