You will get this error, if you haven’t updated/installed your command line tools.
Follow the following steps
- Then open
Xcode > Preferences > Downloads > Command Line Toolsor execute in Terminal:
xcode-select --install - Select
Xcode > Preferences > Locations > Command Line Tools