Hi,
these are well known problems:
CSS rules were not executed. Error when running: ‘node -v’. Is Node.js available during analysis?
JavaScript and/or TypeScript rules were not executed. Error when running: ‘node -v’. Is Node.js available during analysis?
This is fixed with a NodeJS installation and add to path.
But in Jenkins, we use only NodeJS versions, that are installed by Jenkins itself. We had a real NodeJS installation on every Jenkins node, but that made problems, as we need a bunch of different NodeJS versions available for all our npm builds.
And we use it like that in our npm pipelines, i.e.:
nodejs(configId: 'nexus-pr-linux', nodeJSInstallationName: 'NodeJS 12.8.1') {
...
}
Also the sonar scan runs fine that way.
BUT when Jenkins node has no NodeJS installation, it’s a problem for non npm builds, i.e. a java application with some css and js files
Why not ship the scanner with Node.js like you did with Typescript already ?
see Release SonarJS 6.4 · SonarSource/SonarJS · GitHub
- The plugin no longer relies on user-provided TypeScript: TypeScript is now shipped with the analyzer.
Gilbert