SonarCloud Anlysis Task Fails - ##[error]ERROR: D:\a\1\.sonarqube\out\.sonar\mod11\css-bundle\node_modules\micromatch\index.js:44

Hi @Lena

For a while now we have had a problem with a SonarCloud Analysis task running from an Azure DevOps pipeline using a Microsoft hosted agent. This problem was masked for some time as the following code quality check step was not configured correctly so build were still showing as successful. I have just checked through the pipeline history and it seems that this started happening around 25/06/2019 but was only reported to me last week.

I had checked the forum and found a near identical issue that you had commented on but this seems to have related to a specific version of node.js. We are not using node.js in this project so I’m wondering whether the reference to node.js relates to what is installed on the hosted build agent machine?

Please let me know if you require any further information? Pasted below is the failing portion of the analysis task;

##[error]ERROR: D:\a\1.sonarqube\out.sonar\mod10\css-bundle\node_modules\micromatch\index.js:44
ERROR: D:\a\1.sonarqube\out.sonar\mod10\css-bundle\node_modules\micromatch\index.js:44
##[error]ERROR: let isMatch = picomatch(String(patterns[i]), { …options, onResult }, true);
ERROR: let isMatch = picomatch(String(patterns[i]), { …options, onResult }, true);
##[error]ERROR: ^^^
ERROR: ^^^
##[error]ERROR: SyntaxError: Unexpected token …
ERROR: SyntaxError: Unexpected token …
##[error]ERROR: at Object.exports.runInThisContext (vm.js:76:16)
ERROR: at Object.exports.runInThisContext (vm.js:76:16)
##[error]ERROR: at Module._compile (module.js:542:28)
ERROR: at Module._compile (module.js:542:28)
##[error]ERROR: at Object.Module._extensions…js (module.js:579:10)
ERROR: at Object.Module._extensions…js (module.js:579:10)
##[error]ERROR: at Module.load (module.js:487:32)
ERROR: at Module.load (module.js:487:32)
##[error]ERROR: at tryModuleLoad (module.js:446:12)
ERROR: at tryModuleLoad (module.js:446:12)
##[error]ERROR: at Function.Module._load (module.js:438:3)
ERROR: at Function.Module._load (module.js:438:3)
##[error]ERROR: at Module.require (module.js:497:17)
ERROR: at Module.require (module.js:497:17)
##[error]ERROR: at require (internal/module.js:20:19)
ERROR: at require (internal/module.js:20:19)
##[error]ERROR: at Object. (D:\a\1.sonarqube\out.sonar\mod10\css-bundle\node_modules\stylelint\lib\isPathIgnored.js:4:20)
ERROR: at Object. (D:\a\1.sonarqube\out.sonar\mod10\css-bundle\node_modules\stylelint\lib\isPathIgnored.js:4:20)
##[error]ERROR: at Module._compile (module.js:570:32)
ERROR: at Module._compile (module.js:570:32)
##[error]ERROR: Analysis didn’t terminate normally, please verify ERROR and WARN logs above. Exit code 1
ERROR: Analysis didn’t terminate normally, please verify ERROR and WARN logs above. Exit code 1

Any help would be most appreciated.

Kind regards

@benz66

Hi,

I think updating Nodejs to 8.3 or later should help you.

1 Like

Many thanks Lena,

I though that this was the way forward but am still testing a few things.

Kind regards

Ben