Initial problems with Kitura tutorial dyld: Library not loaded:

My Mac runs Mojave 10.14.5. with Xcode 10.2.1 and Swift 4.2.
As I worked through the Kitura Tutorial: Getting Started With Server-Side Swift

I got an error message after following the instructions (below) so I must be missing a step.

Open Terminal and enter the following commands:

mkdir KituraTIL
cd KituraTIL
swift package init --type executable

Here is the error message

dyld: Library not loaded: @rpath/llbuild.framework/Versions/A/llbuild
Referenced from: /Library/Developer/CommandLineTools/usr/bin/swift-package
Reason: image not found
Abort trap: 6

Here is a screen shot of my Terminal window

Gregorys-MacBook-Pro-2:~ gs$ ls
Desktop Downloads Library Pictures
Developer Dropbox Movies Public
Documents Dropbox (Old) Music

Gregorys-MacBook-Pro-2:~ gs$ mkdir KituraTIL
Gregorys-MacBook-Pro-2:~ gs$ ls
Desktop Downloads KituraTIL Music
Developer Dropbox Library Pictures
Documents Dropbox (Old) Movies Public

Gregorys-MacBook-Pro-2:~ gs$ cd KituraTIL
Gregorys-MacBook-Pro-2:KituraTIL gs$ ls

Gregorys-MacBook-Pro-2:KituraTIL gs$ swift package init --type executable
dyld: Library not loaded: @rpath/llbuild.framework/Versions/A/llbuild
Referenced from: /Library/Developer/CommandLineTools/usr/bin/swift-package
Reason: image not found
Abort trap: 6
Gregorys-MacBook-Pro-2:KituraTIL gs$

I also noticed that the tutorial versions of couchdb and Homebrew are both 1.7.1 whereas my terminal reports couchdb 1.7.2 and Homebrew 1.7.2_1

from tutorial

{
“couchdb”: “Welcome”,
“uuid”: “29b2fe0fb4054c61e6b4b8e01761707b”,
“version”: “1.7.1”,
“vendor”: {
“name”: “Homebrew”,
“version”: “1.7.1”
}
}

from terminal

{
“couchdb”:“Welcome”,
“uuid”:“44d725b67894c666167224db5a6dc62d”,
“version”:“1.7.2”,
“vendor”: {
“name”:“Homebrew”,
“version”:“1.7.2_1”
}
}

@dokun1 Can you please help with this when you get a chance? Thank you - much appreciated! :]

@greg_s That looks like an issue with the setup of Swift itself for usage from the command line. The following solution looks like it might match your issue:

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 ?

@dokun1 Do you have any feedback about this? Thank you - much appreciated! :]

Feedback sent 18 days ago. I was stumped until I got Chris Bailey’s suggestion. Thanks, beers all round !