SonarCloud analysis fails : SyntaxError: Unexpected token

ERROR: /Users/runner/runners/2.163.1/work/1/.sonarqube/out/.sonar/mod0/css-bundle/node_modules/micromatch/index.js:44
ERROR: let isMatch = picomatch(String(patterns[i]), { …options, onResult }, true);
ERROR: ^^^
ERROR:
ERROR: SyntaxError: Unexpected token …
ERROR: at createScript (vm.js:56:10)
ERROR: at Object.runInThisContext (vm.js:97:10)
ERROR: at Module._compile (module.js:549:28)
ERROR: at Object.Module._extensions…js (module.js:586:10)
ERROR: at Module.load (module.js:494:32)
ERROR: at tryModuleLoad (module.js:453:12)
ERROR: at Function.Module._load (module.js:445:3)
ERROR: at Module.require (module.js:504:17)
ERROR: at require (internal/module.js:20:19)
ERROR: at Object. (/Users/runner/runners/2.163.1/work/1/.sonarqube/out/.sonar/mod0/css-bundle/node_modules/stylelint/lib/isPathIgnored.js:4:20)
ERROR: Analysis didn’t terminate normally, please verify ERROR and WARN logs above. Exit code 1

I did some searching and it suggested updating the node js to >= 8 but the code is based on 10.

Would the fact it’s using it’s being build using Azure DevOps hosted agent macOS have anything to do with it?

Hi,

Both current image versions for Mac OS hosted agent are running Node.js 6.17, which is pretty old (see here and here for reference)

I suggest then to update the node.js using the Node.js installer task available on pipelines (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/node-js?view=azure-devops)

Mickaël

Awesome thank you very much