gpt4 book ai didi

elixir - 为什么我会收到此错误 `(Mix) Could not find an SCM for dependency :cowboy `

转载 作者:行者123 更新时间:2023-12-04 12:24:22 26 4
gpt4 key购买 nike

我有一个 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

运行 mix deps.get 时出现以下错误在 ubuntu 上:
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在我的系统上?

最佳答案

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

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

关于elixir - 为什么我会收到此错误 `(Mix) Could not find an SCM for dependency :cowboy `,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49001788/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com