Is Node.js available during analysis?

Setup:

  • SonarQube 8.1
  • Code Analyzer for CSS: 1.1.1 (build 1010)
  • Code Analyzer for JS : 6.1 (build 11503)

When I run an analysis regarding CSS or JS code, I get the error that SonarQube can’t find Node.

  1. I’ve installed nodejs
  2. I’ve added this line: sonar.nodejs.executable=/usr/bin/node. At the end of /opt/sonarqube/conf/sonar.properties
  3. Added node to path (~/.bashrc): PATH="$HOME/.local/bin:$HOME/bin:/usr/bin/node:$PATH"

However it keeps showing this error.

1 Like

hello @svargas,

did you install Node.js on the machine where you run the scanner? It is required on the machine where you run the analysis, not where SonarQube is installed.

Can you include full log from the analysis, so we can analyze the issue?

1 Like

@saberduck

NodeJS installation on the scanning maching solved the issue. Thanks!

adding below code in docker-qa file worked.
versionSpec is the version in which your running your application.

  • task: NodeTool@0
    inputs:
    versionSource: ‘spec’
    versionSpec: ‘16.15.1’