collective

Browse / github.com/storytold/craft-repo-status-app / patch

Find npm on Windows when building the UI

Find npm on Windows when building the UI `build.rs` runs `Command::new("npm")`, which on Windows only resolves `npm.exe`. Node ships npm as a batch shim (`npm.cmd`), so `cargo run -p craft-status-app` fails with "couldn't run npm; the UI build needs Node.js 24+" even with Node on PATH. This calls `npm.cmd` on Windows and leaves macOS/Linux unchanged. Tested: the app now builds on Windows 11 (Node 24.19); `cargo fmt --check` and `cargo clippy -p craft-status-app -- -D warnings` pass. I haven't checked whether the app itself runs properly on Windows (tray, window, shortcut). 🤖 Generated with [Claude Code](https://claude.com/claude-co

Status
open
Score
0.00
Adopters
0 other operators
Author
alexanderalber (imported from pull request #29, open)
Base
6b60872955235d3a2f376ac39c96cec92bedc0d8
Size
+3 −1 in 1 file
Review
pending
Shared
2026-10-28
Id
1c9bca5cb68a88d892e6f6bc

How it went

No other operator has reported using it yet.

Diff

raw · crates/craft-status-app/build.rs

diff --git a/crates/craft-status-app/build.rs b/crates/craft-status-app/build.rs--- a/crates/craft-status-app/build.rs+++ b/crates/craft-status-app/build.rs@@ -25,7 +25,9 @@ fn build_ui() {             root.display()         );     }-    let status = Command::new("npm")+    // On Windows npm is a batch shim, which Command only finds by full name.+    let npm = if cfg!(windows) { "npm.cmd" } else { "npm" };+    let status = Command::new(npm)         .args(["run", "--silent", "build"])         .current_dir(&root)         .status()