From f2b640accb0f4364ef3e189b34af03ebabe8dea7 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Sat, 27 Dec 2025 09:08:00 +0000 Subject: [PATCH] map error from cmd.spawn in npm::install If the tool (yarn) does not exists, spawn() raise an error, but the error message is just like a `No such file or directory`. So it is hard to understand which application/file/directory has a problem. This commit maps the error to expose the problem is around yarn. --- src/build_helper/src/npm.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/build_helper/src/npm.rs b/src/build_helper/src/npm.rs index f250ced4dc8a7..2a558b5618b3d 100644 --- a/src/build_helper/src/npm.rs +++ b/src/build_helper/src/npm.rs @@ -22,7 +22,16 @@ pub fn install(src_root_path: &Path, out_dir: &Path, yarn: &Path) -> Result::from(format!( + "unable to run yarn: {}", + err.kind() + ))) + })? + .wait()?; if !exit_status.success() { eprintln!("yarn install did not exit successfully"); return Err(io::Error::other(Box::::from(format!(