Not able to Exclude node_modules entire folder in node js

I am not able to excude node_modules entire folder
here is my .properties file config
sonar.exclusions=node_modules/**/*

please help me !!

Hey there.

You need to add more details.

  • What version of SonarQube are you using?
  • What is the structure of your repository? Where is the sonar-project.properties file located relative to the root fo your project?
  • What command are you using to run analysis?
  • How do you know the files aren’t excluded?

ok sharing

  • What version of SonarQube are you using? —> 9.5.0
  • What is the structure of your repository?–> E:\Harshit\sourcecode
    Where is the sonar-project.properties file located relative to the root fo your project?—> E:\Harshit\sonar-scanner-cli-4.0.0.1744-windows\sonar-scanner-4.0.0.1744-windows\conf
  • What command are you using to run analysis?–> sonar-scanner.bat
  • How do you know the files aren’t excluded? —> in the report they showcased bugs in node_modules folder
    [/quote]

Instead of setting scanner-level properties, I would suggest either:

  • Creating a sonar-project.properties file in your repository (E:\Harshit\sourcecode)
  • Passsing sonar.exclusions to your analysis command, such as sonar-scanner.bat -Dsonar.exclusions=node_modules/**/*)

No it’s not working
They still entering node_modules folder

I got a version error like :- org.sonarsource.nodejs.NodeCommandException: Only Node.js v12.22 or later is supported, got 8.9.

so which version of sonarqube should i use with node js 8.9 ?

Take a look at the documentation on Scanner Environment.

Thanks for replying i have successfully completed same.