A worthwhile suggestion! It led me to this solution on Stackoverflow. I opened Xcode > Preferences > Locations > Command Line Tools and selected an Xcode version. I choose the latest version i.e. Xcode 10.2.1 (10E1001). This got me running again. Much appreciated.
This may be something the tutorial author might like to know about because it begs the question: for a tutorial using command line why leave Command Line Tools blank ?