UndefinedFunctionError phoenix elixir new project

流过昼夜 提交于 2020-01-02 00:59:09

问题


With a fresh install of Phoenix, I tried to trigger a new project, and when I try to run the server, I'm met with:

Unchecked dependencies for environment dev:
 * gettext (Hex package)
  the dependency is not available, run "mix deps.get"
 * phoenix_live_reload (Hex package)
  the dependency is not available, run "mix deps.get"
 * cowboy (Hex package)
 * List item
...

but when I run mix deps.get I get:

Running dependency resolution
** (UndefinedFunctionError) undefined function Access.Map.get_and_update!/3 (module Access.Map is not available)
    Access.Map.get_and_update!(%Mix.Dep{app: :cowboy, deps: [], extra: [], from: "/Users/victoriawagman/Dropbox/Hemsidor/digitalocean/hello_phoenix/mix.exs", manager: nil, opts: [hex: :cowboy, build: "/Users/victoriawagman/Dropbox/Hemsidor/digitalocean/hello_phoenix/_build/dev/lib/cowboy", dest: "/Users/victoriawagman/Dropbox/Hemsidor/digitalocean/hello_phoenix/deps/cowboy"], requirement: "~> 1.0", scm: Hex.SCM, status: {:unavailable, "/Users/victoriawagman/Dropbox/Hemsidor/digitalocean/hello_phoenix/deps/cowboy"}, top_level: true}, :deps, #Function<13.85268495/1 in Hex.Resolver.attach_dep_and_children/3>)
    (hex) lib/hex/resolver.ex:188: Hex.Resolver.attach_dep_and_children/3
    (hex) lib/hex/resolver.ex:148: Hex.Resolver.get_deps/5
    (hex) lib/hex/resolver.ex:107: Hex.Resolver.activate/6
    (hex) lib/hex/resolver.ex:31: Hex.Resolver.resolve/3
    (hex) lib/hex/remote_converger.ex:31: Hex.RemoteConverger.converge/2
    (mix) lib/mix/dep/converger.ex:92: Mix.Dep.Converger.all/4
    (mix) lib/mix/dep/converger.ex:47: Mix.Dep.Converger.converge/4

I'm at loss for what to search for to dig deeper into trying to figure out what I can do to understand what is wrong and fix it. Please assume that I have no clue, I'm learning.

Also, I don't know how to separately re-install just hex, so I'm looking for that now, if it is so that I also have a corrupt install of hex.


回答1:


It seems that my install of hex was corrupt. running

mix local.hex

as per Henrik's suggestion solved this! He'd a post by someone else indicating that hex might be corrupt.

Next up was a warning about missing module brunch, but that was solved by running npm install (as the output when triggering the server suggested).

Happy days!



来源:https://stackoverflow.com/questions/34567624/undefinedfunctionerror-phoenix-elixir-new-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!