mix deps.get
warning: use Mix.Config is deprecated. Use the Config module instead
config/config.exs:8
warning: use Mix.Config is deprecated. Use the Config module instead
config/dev.exs:1
Failed to fetch record for phoenix_live_reload from registry (using cache instead)
:timeout
:timeout
Failed to fetch record for phoenix_html from registry (using cache instead)
** (Mix) No package with name phoenix_html (from: mix.exs) in registry
Phoenix的问题
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
关注让阿豪来帮你解答,本回答参考chatgpt3.5编写提供,如果还有疑问可以评论或留言
问题:为什么出现了这些警告和错误,如何解决? 回答:- 警告 "use Mix.Config is deprecated. Use the Config module instead" 的意思是,使用 Mix.Config 模块已经过时了,建议使用 Config 模块代替。这个警告出现在两个文件中:config/config.exs 和 config/dev.exs 中。解决方法是,在代码中修改所有使用 Mix.Config 的地方,改为使用 Config。 例如: 原来的代码: config :my_app, key: Mix.Config.get(:my_app, :key) 修改后的代码: config :my_app, key: Config.get(:my_app, :key)
- 警告 "Failed to fetch record for phoenix_live_reload from registry (using cache instead): timeout" 的意思是,在从库中获取 phoenix_live_reload 时超时了,程序使用了缓存。解决方法是,尝试更换镜像源或等待一段时间后再尝试安装。 例如: $ mix hex.config 打印出当前配置的镜像源列表,尝试更改源: $ mix hex.config mirror-url https://hexpm.upyun.com
- 错误 "No package with name phoenix_html in registry" 的意思是,没有找到名为 phoenix_html 的包。这个错误通常是因为包名称错误或者源配置有误导致的。解决方法是,检查包的名称是否正确,并尝试更换镜像源。 例如: 在 mix.exs 文件中,确保 phoenix_html 的包名正确: defp deps do [
other dependencies,
{:phoenix_html, "~> 2.14"} ] end 重新配置源: $ mix hex.config mirror-url https://hexpm.upyun.com 然后重新运行
mix deps.get命令。 代码示例: 这里展示一个修改 Mix.Config 的示例: defmodule MyApp.Config do use Mix.Config config :my_app, key: "my_secret_key" end 原来的代码: config :my_app, key: Mix.Config.get(:my_app, :key) 修改后的代码: config :my_app, key: MyApp.Config.get(:my_app, :key)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报