Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sonar-scanner command not found in mac

i followed the directions as per the SonarQube documentation. I installed the sonarqube and sonar-scanner from the instructions into my applications folder. But having trouble getting my terminal to recognize sonar-scanner. I checked my path variable by trying the following:

echo $PATH

and got...

/Users/Neptune/Applications/SonarQube/bin:/Users/Neptune/Applications/SonarScanner/bin:/Users/Neptune/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/domino:/Library/TeX/texbin:/Library/Apple/usr/bin

This is what i have for my path

export PATH="/Users/Neptune/Applications/SonarScanner/bin:$PATH"
export PATH="/Users/Neptune/Applications/SonarQube/bin:$PATH"

I then changed it to:

export PATH="/Users/Neptune/Applications/SonarScanner/bin/sonar-scanner:$PATH"

AFter each method, i restarted my shell and still no luck. I then went to my project root directory where i have my python code installed and added a project.properties file but i don't see how that helps with the terminal recognizing sonar-scanner -h as a command. Can someone please help. Thanks

SonarQube fires for me and im able to start a localhost:9000 server. Its getting mac to recognize sonar-scanner is whats causing me problems.

edit: i managed to get sonar-scanner working. But it's such a painful process. I have to always type:

sh /Applications/SonarScanner/bin/sonar-scanner
like image 930
turtle_in_mind Avatar asked Mar 15 '26 23:03

turtle_in_mind


1 Answers

I was facing the same issue:

zsh: command not found: sonar-scanner

I have installed sonar globally

npm install sonarqube-scanner -g  

And it worked for me.

like image 106
Ananya Avatar answered Mar 18 '26 19:03

Ananya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!