diff --git a/rust-bins/xtask/src/main.rs b/rust-bins/xtask/src/main.rs index 092f77a2985e27711899edb35efade8203d97aa8..b5dbfc219b43dea477afd3940a1662ede8f3852c 100644 --- a/rust-bins/xtask/src/main.rs +++ b/rust-bins/xtask/src/main.rs @@ -54,6 +54,11 @@ fn main() -> Result<()> { Command::new("cargo").arg("--version").status()?; if !args.skip_npm { + println!("Check nvm …"); + if exec_should_success(Command::new("nvm").arg("--version")).is_err() { + println!("Duniter requires nvm, but nvm is not found, please install it or add it to your PATH. Nvm installation link: https://raw.githubusercontent.com/nvm-sh/nvm/v{}/install.sh", NVM_VERSION); + std::process::abort(); + } println!("Check node version …"); if exec_and_get_stdout(Command::new("node").arg("-v")) .unwrap_or_default() @@ -73,10 +78,6 @@ fn main() -> Result<()> { } fn install_and_use_node_version() -> Result<()> { - if exec_should_success(Command::new("nvm").arg("--version")).is_err() { - println!("Duniter need nvm to build, please install it: https://raw.githubusercontent.com/nvm-sh/nvm/v{}/install.sh", NVM_VERSION); - std::process::abort(); - } exec_should_success(Command::new("nvm").args(&["install", NODE_VERSION]))?; exec_should_success(Command::new("nvm").args(&["use", NODE_VERSION])) }