Error when using influx CLI

I installed the influx CLI according to the instruction here. However, whenever I run a command (e.g. influx ping) I get the error

Error: InfluxDB OSS-only command failed: unable to decode response content type "text/html"

Any idea why this is happening?