When I open up Terminal and I type Swift, an error appear and Xcode doesn't work either.

When I open up Terminal, and I type up Swift an error appears. I have installed CommandLineTools, and it has installed itself 12 times without my acknowledgement. I have also installed Lua, but I am not sure wheater that has installed properly either. When I open up Xcode, the app just closes itself. I am anxious, and most importantly I am a student, and I love programming, so this hurts me. I currently have the late 2016 MacBook Pro (without touchbar), and I am on macOS High Sierra version 10.13.3 (17D47). The paragraph below this is the error which appeared on Terminal. If anyone can help me, it would be greatly appreciated!


Last login: Mon Feb 5 16:36:25 on ttys000

Groshvins-MBP:~ P.W$ swift

Welcome to Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2). Type :help for assistance.

1>


When I uninstall Xcode, this error appears as well!


Last login: Mon Feb 5 17:56:49 on ttys000

Groshvins-MBP:~ P.W$ swift

xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist

Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.

See `man xcode-select` for more details.

Groshvins-MBP:~ P.W$

>The paragraph below


Note you can add images, but in a silent fail, others here are prohibited from viewing them. As an alternative, use your words, or...upload them to a server, add the urls to a comment and be sure to break the urls to avoid waiting for moderation.


Example: h ttp://www.ebay.com

You say you've reinstalled the Command Line Tools, but have you reinstalled Xcode? Also, make sure it is in /Applications, and not somewhere else.

When I open up Terminal and I type Swift, an error appear and Xcode doesn't work either.
 
 
Q