Azure Devops - Javascript only repos

We are using SonarCloud with Azure Devops and the SonarCloud extension (SonarCloud - Visual Studio Marketplace) and this works fine for .net core projects. However I’m no faced with a repo that is javascript only so no project or solution file exists. I Initially tried adding the same tasks in this new build script (yaml) but that did not work. The tasks I’m using below.

SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1
SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1

And here is the exception:

The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:

  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
    10:39:33.327 Post-processing failed. Exit code: 1
    The process ‘C:\Agents\NetCore_BuildAgent_work_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\1.9.0\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1

How do I make scanning of a javascript-only repos work? What should I be doing different?
Thanks!
/Pelle

Hi,

You can use the Scanner in standalone mode directly, this is documented here : https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-azure-devops/#analysing-other-project-types

Let me know if it’s working.

Thanks !

Mickaël