Step 1: Use Mix to Create Our New Project
Learn how to create a new project using Mix and its directory structure.
We'll cover the following
The mix
command-line utility manages Elixir projects used to create new projects, manages a project’s dependencies, runs tests, and runs code. If you have Elixir installed, you also have mix
. Let’s try running it now:
$ mix help
mix # Run the default task (current: mix run)
mix archive # List all archives
mix archive.build # Archive this project into a .ez file
: : : :
mix new # Create a new Elixir project
mix run # Run the given file or expression
mix test # Run a project's tests
iex -S mix # Start IEx and run the default task
This is a list of the standard tasks that come with mix
. Your list may be a little different, depending on your version of Elixir. For more information on a particular task, we can use mix help
.
$ mix help deps
Let’s list all dependencies and their statuses. Dependencies must be specified in the mix.exs
file.
Here’s a terminal for practice:
Get hands-on with 1400+ tech skills courses.