diff --git a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/nodejs/NodeCommandBuilderImpl.java b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/nodejs/NodeCommandBuilderImpl.java index 1290a2d8743..be341a0b2f3 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/nodejs/NodeCommandBuilderImpl.java +++ b/sonar-plugin/sonar-javascript-plugin/src/main/java/org/sonar/plugins/javascript/nodejs/NodeCommandBuilderImpl.java @@ -212,7 +212,11 @@ private String getVersion(String nodeExecutable) throws NodeCommandException { emptyList(), output::append, LOG::error, - Map.of() + //Avoid default error message from run-node: https://github.com/sindresorhus/run-node#customizable-cache-path-and-error-message + Map.of( + "RUN_NODE_ERROR_MSG", + "Couldn't find the Node.js binary. Ensure you have Node.js installed." + ) ); nodeCommand.start(); int exitValue = nodeCommand.waitFor();