From 76897e2b97686e173873a71e9336f96b759d9cb8 Mon Sep 17 00:00:00 2001 From: kkkman22 <2594387207@qq.com> Date: Tue, 20 Jan 2026 10:32:35 +0800 Subject: [PATCH] =?UTF-8?q?:=20=E6=B7=BB=E5=8A=A0=20fnm=20=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E6=94=AF=E6=8C=81=20(#564)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gruby Wang --- src-tauri/src/commands/misc.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src-tauri/src/commands/misc.rs b/src-tauri/src/commands/misc.rs index 27d9f7544..f7f481570 100644 --- a/src-tauri/src/commands/misc.rs +++ b/src-tauri/src/commands/misc.rs @@ -322,6 +322,19 @@ fn scan_cli_version(tool: &str) -> (Option, Option) { search_paths.push(std::path::PathBuf::from("C:\\Program Files\\nodejs")); } + // 添加 fnm 路径支持 + let fnm_base = home.join(".local/state/fnm_multishells"); + if fnm_base.exists() { + if let Ok(entries) = std::fs::read_dir(&fnm_base) { + for entry in entries.flatten() { + let bin_path = entry.path().join("bin"); + if bin_path.exists() { + search_paths.push(bin_path); + } + } + } + } + // 扫描 nvm 目录下的所有 node 版本 let nvm_base = home.join(".nvm/versions/node"); if nvm_base.exists() {