How to run Swift on GitHub codespaces

Question:

So I have a github codespace with a file called main.swift, and I’m wondering, how do I run it?
I tried swift main.swift but it gave bash: swift: command not found.

1 Like

You probably need to install swift though the shell

1 Like

How do I install it?

Hi @SnakeyKing!

In the future, I wouldn’t ask this on Replit Ask, but usually, you would run programs with their respective shell commands like you were doing. However, I don’t believe swift is installed by default on Codespaces. I personally have no idea how you would actually install it, but maybe Swift.org - Getting Started has some information.

3 Likes