Mix.install

You're seeing just the function install, go back to Mix module for more information.
Link to this function

install(deps, opts \\ [])

View Source (since 1.12.0)

Installs and starts dependencies.

The given deps should be in the same format as defined in a regular Mix project. See mix help deps for more information. As a shortcut, an atom can be given as dependency to mean the latest version. In other words, specifying :decimal is the same as {:decimal, ">= 0.0.0"}.

After each successful installation, a given set of dependencies is cached so starting another VM and calling Mix.install/2 with the same dependencies will avoid unnecessary downloads and compilations. The location of the cache directory can be controlled using the MIX_INSTALL_DIR environment variable.

This function can only be called outside of a Mix project and only with the same dependencies in the given VM.

Note: this feature is currently experimental and it may change in future releases.

Options

  • :force - if true, removes install cache. This is useful when you want to update your dependencies or your install got into an inconsistent state (Default: false)

  • :verbose - if true, prints additional debugging information (Default: false)

  • :consolidate_protocols - if true, runs protocol consolidation via the mix compile.protocols task (Default: true)

Examples

Mix.install([
  :decimal,
  {:jason, "~> 1.0"}
])