Wrap SonarQube Scanner as a node module.
You can install nodejs-sonar-scanner as a development dependency and add it as a script property in your package.json.
npm i nodejs-sonar-scanner --save-dev
{
"scripts": {
"sonar-scanner": "node_modules/nodejs-sonar-scanner/bin/sonar-scanner"
}
}
npm run sonar-scanner
{
"scripts": {
"sonar-scanner": "node_modules/nodejs-sonar-scanner/bin/sonar-scanner -t 4.2.0.1873"
}
}
npm run sonar-scanner