Xcode-select installをしても動かなかった。
Xcode-select --installと打っても、以下のエラーが起きた
Can't install the software because it is not currently available from the Software Update server

ここ https://developer.apple.com/download/more/
を開いてcommand line toolsと検索すると、dmgファイル一覧が表示されるのでDL&インストール。