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 41aa2fa0bd7..0b11ad0d6e2 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 @@ -182,8 +182,7 @@ private void checkNodeCompatibility(String nodeExecutable) throws NodeCommandExc if (!actualNodeVersion.isGreaterThanOrEqual(minNodeVersion)) { throw new NodeCommandException( String.format( - "Only Node.js v%s or later is supported, got %s.", - minNodeVersion, + "Unsupported Node.JS version detected %s. Please upgrade to the latest Node.JS LTS version.", actualNodeVersion ) ); diff --git a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/nodejs/NodeCommandTest.java b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/nodejs/NodeCommandTest.java index 919ba8f0f8c..f4400c09636 100644 --- a/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/nodejs/NodeCommandTest.java +++ b/sonar-plugin/sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/nodejs/NodeCommandTest.java @@ -112,7 +112,9 @@ void test_min_version() throws IOException { builder().minNodeVersion(Version.create(99, 0)).pathResolver(getPathResolver()).build() ) .isInstanceOf(NodeCommandException.class) - .hasMessageStartingWith("Only Node.js v99.0 or later is supported, got"); + .hasMessageMatching( + "Unsupported Node.JS version detected .* Please upgrade to the latest Node.JS LTS version." + ); } @Test