I'd confirm a few things about your environment:
Do the commands work when run directly via Terminal directly on these specific Macs? That is, when logged into the macOS user account as if it were on your desk, and not through ssh?
When using ssh, are you logging in to a user account that is already logged in through the system UI shell?
Do you have a developer toolchain selected? The output of xcode-select -p
will point to an installation of Xcode, the Command Line Tools package, or nothing at all. When you run a command like /usr/bin/clang
, that is a shim that bounces your command invocation over to the selected developer toolchain, and runs the tool version coming from that toolchain. That allows you to have multiple versions of Xcode or the Command Line Tools package installed, and switch between them.
— Ed Ford, DTS Engineer