We’re getting the following error in our logs, which is accurate:
ERROR: CSS rules were not executed. Error when running: 'node -v'. Is Node.js available during analysis?
org.sonarsource.nodejs.NodeCommandException: Error when running: 'node -v'. Is Node.js available during analysis?
Is there someway to bundle nodejs with sonar-scanner? Our Jenkins nodes are pretty bare-bones. We use containers for everything, including node builds. We do not install build tools on the instance itself. How can we point to an internal nodejs? Or use a docker container?
Configuration info:
INFO: SonarScanner 4.3.0.2102
INFO: Java 1.8.0_211 Oracle Corporation (64-bit)
INFO: Linux 4.15.0-42-generic amd64
INFO: User cache: /home/vcap/.sonar/cache
INFO: SonarQube server 8.3.1
There is indeed a docker image for the sonar-scanner that bundles node.js. Please note that this is not yet considered an official image and we welcome feedback on your experiences utilizing it, should you choose to!
No we currently don’t bundle NodeJS with the scanner, I’m not even sure this is possible. The easiest solution would be to install NodeJS on the Jenkins nodes that perform the scan, or as Jeff mentioned, use the Sonar Scanner Docker image.