From 6bbc2cfac846851c39bec77c41ef66792aee6e74 Mon Sep 17 00:00:00 2001 From: sususu98 Date: Wed, 25 Feb 2026 17:39:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20npm=20=E5=AE=89=E8=A3=85=E5=90=8E?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20command=20-v=20=E9=AA=8C=E8=AF=81=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20Claude=20Code=20FAQ=20=E4=B8=BA=E5=8E=9F?= =?UTF-8?q?=E7=94=9F=E5=AE=89=E8=A3=85=E5=99=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/claude-code.md | 4 ++-- setup.sh | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/guide/claude-code.md b/docs/guide/claude-code.md index 2873459..4003b01 100644 --- a/docs/guide/claude-code.md +++ b/docs/guide/claude-code.md @@ -47,6 +47,6 @@ $key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/ra ## 常见问题 - **Q: 安装后无法使用?** - - A: 确保你已安装 Node.js (推荐 v18+)。 + - A: 请确保已重新打开终端。Claude Code 使用原生安装器,无需 Node.js。如果问题仍存在,检查 `~/.local/bin` 是否在 PATH 中。 - **Q: 权限错误?** - - A: 在 macOS/Linux 上可能需要 `sudo` 权限来安装全局 npm 包,但我们的脚本尝试使用非 root 方式或引导安装 fnm。 + - A: Claude Code 原生安装器会安装到用户目录 (`~/.local/bin`),通常不需要 `sudo`。 diff --git a/setup.sh b/setup.sh index dc94d69..4159e39 100755 --- a/setup.sh +++ b/setup.sh @@ -393,8 +393,14 @@ install_tool() { echo -e " 执行: ${CYAN}$install_cmd${NC}" if eval "$install_cmd"; then hash -r 2>/dev/null || true - success "$tool_name 安装成功!" - return 0 + local tool_cmd=$(get_tool_cmd "$tool_num") + if command -v "$tool_cmd" >/dev/null 2>&1; then + success "$tool_name 安装成功!" + return 0 + else + warning "$tool_name 可能已安装,但需要重新打开终端才能生效" + return 0 + fi else error "$tool_name 安装失败" return 1