pg_basebackup: could not set compression level -1
I tried the command without a compression option and received this error message:

pg_basebackup: could not create file "/dir/names/base.tar": Permission denied


which revealed that the destination directory was not writable for the user. Changing permissions or ownership solved the problem.

Unfortunately, the original error message was not as informative as it could have been.