I recently encountered this same issue. This happens because some packages on the repo are dependent on xcode to build. Since you are using a Mac, I'll suggest you install xcode. That solved the issue for me
xcode