为什么我会收到此错误 `(Mix) 找不到依赖项的 SCM :cowboy `

Why do I get this error `(Mix) Could not find an SCM for dependency :cowboy `

我有一个 elixir 项目,下面是混合配置文件:

defmodule MyFirstApp.Mixfile do
  use Mix.Project

  def project do
    [
      app: :my_first_app,
      version: "0.1.0",
      elixir: "~> 1.5",
      start_permanent: Mix.env == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger],
      mod: {MyFirstApp, []}
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      # {:dep_from_hexpm, "~> 0.3.0"},
      # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"},
      {:cowboy, "~> 1.1.2"},
      {:plug, "~> 1.3.4"},
      {:slime, "~> 0.14"}
    ]
  end
end

当我在 ubuntu 上 运行 mix deps.get 时出现以下错误:

mix deps.get
Could not find Hex, which is needed to build dependency :cowboy
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] ** (Mix) Could not find an SCM for dependency :cowboy from MyFirstApp.Mixfile
Exited with code 1

我不明白为什么会发生在这里。似乎缺少 Hex 的依赖项,但如何在我的系统上安装 Hex

你的 shell 应该 运行 mix local.hex。它将 installs Hex locally.

Hex 是 Erlang VM 的包管理器,当前提供与 Elixir 的构建工具 Mix 集成的任务。