Failed to parse Node.js version

Sonarqube 7.9.3 with Jenkins Maven plugin 3.6.0:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin: (default-cli) on project devops-sample-project: Failed to parse Node.js version, got 'Node Commands
[ERROR] Syntax:
[ERROR] node {operator} [options] [arguments]
[ERROR] Parameters:
[ERROR] /? or /help - Display this help message.
[ERROR] list - List nodes or node history or the cluster
[ERROR] listcores - List cores on the cluster
[ERROR] view - View properties of a node
[ERROR] online - Set nodes or node to online state
[ERROR] offline - Set one or more nodes to the offline state

Thank you for your help

It looks like your project involves some Javascript, Typescript, or CSS code. Such analysis depends upon the presence of a node.js executable, greater than version 8.

It also looks like you must be analyzing in a Windows environment, because your error indicates that while testing for the presence of node.js, the unrelated Windows command called ‘node’ was invoked but its output didn’t match what was expected.

Your solution should be to install node.js or, if you do indeed have it already, make sure it’s included in your PATH environment variable or pass the path to it via the analysis parameter sonar.nodejs.executable.

Thank you Jeff! I’m new to devops so I’ll be asking silly newbie questions. We moved from Sonarqube 6.7.2 -to 7.9.3 LTS. Then Sonar Maven plugin needed upgrade, so we moved from 3.2 to 3.6. Now node js, which may result in npm upgrade which may have an impact on whole lot of projects. Is there a way out of it for us so that we only upgrade a bear minimum outside of Sonarqube server for now - perhaps lower version of Maven to 3.3 or any other solution not creating domino effect across the enterprise? Thanks again!

Hi Dan,

Can you confirm you’re really looking to analyze Javascript, Typescript, and/or CSS code as part of these projects? If not, you could exclude such files from analysis and then eliminate the node.js dependency.

However if you’re really hoping to scan such languages, the dependency is unavoidable using the latest versions of our analyzers, which we’d highly recommend you stick with. To be clear, you’d only need to have node.js >= 8.0 installed for the sake of our analyzer. It does not necessarily have to coincide with any update of the node/npm version used within projects.

Hope this clarifies things for you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.