Error status returned by url [http://localhost:9000/api/v2/analysis/jres?os=macos&arch=arm64]: 401

I get this on the server " Error status returned by url [http://localhost:9000/api/v2/analysis/jres?os=macos&arch=arm64]: 401 " when to run sonar-scanner in mac, how can i solve it?

How are you providing authentication to the scanner? Are you passing -Dsonar.token=... or setting the SONAR_TOKEN environment variable (docs)