mix hex.outdated (Hex v0.21.2) View Source

Shows all Hex dependencies that have newer versions in the registry.

mix hex.outdated [APP]

By default, it only shows top-level packages explicitly listed in the mix.exs file. All outdated packages can be displayed by using the --all command line option.

By default, hex.outdated will exit with a non-zero exit code (1) if there are any outdated dependencies. You can override this to respect the requirements as specified in your mix.exs file, with the --within-requirements command line option, so it only exits with non-zero exit code if the update is possible.

For example, if your version requirement is "~> 2.0" but the latest version is 3.0, with --within-requirements it will exit successfully, but if the latest version is 2.8, then --within-requirements will exit with non-zero exit code (1).

One scenario this could be useful is to ensure you always have the latest version of your dependencies, except for major version bumps.

If a dependency name is given all requirements on that dependency, from the entire dependency tree, are listed. This is useful if you are trying to figure why a package isn't updating when you run mix deps.update.

Note that when this task determines if a package is updatable it only looks at the project's current set of dependency requirements and what version they are locked to. When mix deps.update is called multiple packages may be updated that in turn update their own dependencies, which may cause the package you want to update to not be able to update.

Command line options

  • --all - shows all outdated packages, including children of packages defined in mix.exs
  • --pre - include pre-releases when checking for newer versions
  • --within-requirements - exit with non-zero code only if requirements specified in mix.exs is met.