From 97822b393b49582fa553607c11120a26370a4473 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 25 Oct 2016 10:49:52 +0200 Subject: [PATCH] Run `npm` with `--silent` to prevent it from stalling on Windows For some reason, node-gyp never exits if we run `npm` commands without the `--silent` option. Passing `--no-progress --no-color` and/or capturing the output of stderr and stdout doesn't help. This will still make the npm commands fail in case something goes wrong, and won't suppress the node-gyp output when running cargo in verbose mode. --- crates/neon-sys/build.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/neon-sys/build.rs b/crates/neon-sys/build.rs index 07f995f98..2e310b270 100644 --- a/crates/neon-sys/build.rs +++ b/crates/neon-sys/build.rs @@ -32,14 +32,14 @@ const NPM_COMMAND : &'static str = "npm.cmd"; fn build_object_file() { // Ensure that all package.json dependencies and dev dependencies are installed. - Command::new(NPM_COMMAND).arg("install").status().ok() + Command::new(NPM_COMMAND).args(&["install", "--silent"]).status().ok() .expect(r#"failed to run "npm install" for neon-sys"#); // Run the package.json `configure` script, which invokes `node-gyp configure` from the local node_modules. - Command::new(NPM_COMMAND).arg("run").arg(if debug() { "configure-debug" } else { "configure-release" }).status().ok().unwrap(); + Command::new(NPM_COMMAND).args(&["run", "--silent"]).arg(if debug() { "configure-debug" } else { "configure-release" }).status().ok().unwrap(); // Run the package.json `build` script, which invokes `node-gyp build` from the local node_modules. - Command::new(NPM_COMMAND).arg("run").arg(if debug() { "build-debug" } else { "build-release" }).status().ok().unwrap(); + Command::new(NPM_COMMAND).args(&["run", "--silent"]).arg(if debug() { "build-debug" } else { "build-release" }).status().ok().unwrap(); } fn link_library() {