From f046bbe204605a60e022f3cf2c23f704caea62ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Wed, 7 Oct 2026 13:38:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BF=87=E7=BC=BA=E5=B0=91=E5=AE=BF?= =?UTF-8?q?=E4=B8=BBNode=E6=97=B6=E7=9A=84npm=E7=9B=AE=E6=A0=87=E5=8D=95?= =?UTF-8?q?=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - npm_command_targets_node_plus_npm_cli_on_linux 先探测 resolve_node_runtime,最小容器无可用宿主 Node 时跳过,避免 cargo test 因缺 Node panic - 探测失败只跳过这一条真机用例,其它解析失败仍照常失败 --- apps/ai-game-creator-shell/src-tauri/src/command_exec.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/ai-game-creator-shell/src-tauri/src/command_exec.rs b/apps/ai-game-creator-shell/src-tauri/src/command_exec.rs index dc406153d..1fb45b6cb 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/command_exec.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/command_exec.rs @@ -2650,6 +2650,11 @@ mod tests { fn npm_command_targets_node_plus_npm_cli_on_linux() { let root = tempfile::tempdir().unwrap(); std::fs::create_dir_all(root.path().join("game")).unwrap(); + // 这条用例走真实 resolve_node_runtime:没有可用宿主 Node 的最小容器里跳过, + // 保持 cargo test 可跑;其它失败仍然照常失败。 + if crate::environment_check::resolve_node_runtime(root.path()).is_err() { + return; + } let spec = resolve_project_command_spec_at( root.path(), "npm",