How to fix a compile problem in Phoenix and its dependencies

Hi

As a newbie I struggle to get a Phoenix Boilerplate compiling:
https://fullstackphoenix.com/boilerplates/HLZf3eROwO from https://fullstackphoenix.com/boilerplates

When I run mix echo.create I get warnings on missing dependencies and a compile error.

As a beginner I don’t now were to look at first to fix the issues. Can you help me with a strategy?

  • elixir / OTP Version
  • Library
  • mix Caches

Thanks a lot.

PS: here are the details:

elixir --version
Erlang/OTP 22 [erts-10.6] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.9.4 (compiled with Erlang/OTP 22)

e76d31b7_boilerplate_praxkit mix --version
Erlang/OTP 22 [erts-10.6] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Mix 1.9.4 (compiled with Erlang/OTP 22)

e76d31b7_boilerplate_praxkit mix deps.get    
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  bamboo 1.5.0
  bcrypt_elixir 2.2.0
  bunt 0.2.0
  certifi 2.5.2
  comeonin 5.3.1
  connection 1.0.4
  cowboy 2.8.0
  cowlib 2.9.1
  credo 1.4.0
  db_connection 2.2.2
  decimal 1.8.1
  ecto 3.4.5
  ecto_sql 3.4.5
  elixir_make 0.6.0
  ex_aws 2.1.3
  ex_aws_s3 2.0.2
  file_system 0.2.8
  floki 0.27.0
  gettext 0.18.1
  hackney 1.16.0
  html_entities 0.5.1
  idna 6.0.1
  jason 1.2.1
  metrics 1.0.1
  mime 1.3.1
  mimerl 1.2.0
  parse_trans 3.3.0
  phoenix 1.5.4
  phoenix_ecto 4.1.0
  phoenix_html 2.14.2
  phoenix_live_dashboard 0.2.6
  phoenix_live_reload 1.2.4
  phoenix_live_view 0.13.3
  phoenix_pubsub 2.0.0
  phx_gen_auth 0.3.0
  plug 1.10.3
  plug_cowboy 2.3.0
  plug_crypto 1.1.2
  postgrex 0.15.5
  premailex 0.3.10
  ranch 1.7.1
  sobelow 0.10.4
  ssl_verify_fun 1.1.6
  sweet_xml 0.6.6
  telemetry 0.4.2
  telemetry_metrics 0.5.0
  telemetry_poller 0.5.1
  unicode_util_compat 0.5.0
  waffle 1.1.1
  waffle_ecto 0.0.9
All dependencies are up to date
➜  e76d31b7_boilerplate_praxkit mix ecto.create 
===> Package idna-6.0.1 not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Writing registry to /Users/andreas/.cache/rebar3/hex/default/registry
===> Generating package index...
===> [appsignal:1.6.2], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.6-beta.1], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.0], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.7.0-alpha.4], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.0-beta.1], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.3], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.7.0-alpha.3], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [batch_loader:0.1.0-beta.4], Bad dependency version for absinthe: ~> 1.4.0 or ~> 1.5.0-beta.
===> [prometheus_httpd:2.1.10], Bad dependency version for prometheus: ~> 3.5 or ~> 4.2.
===> [batch_loader:0.1.0-beta.5], Bad dependency version for absinthe: ~> 1.4.0 or ~> 1.5.0-beta.
===> [appsignal:1.7.0-alpha.2], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.7.0-alpha.1], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [batch_loader:0.1.0-beta.6], Bad dependency version for absinthe: ~> 1.4.0 or ~> 1.5.0-beta.
===> [appsignal:1.12.0], Bad dependency version for decorator: ~> 1.2.3 or ~> 1.3.
===> [appsignal:1.6.1], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.5], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.6-beta.2], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.6], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.7], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [appsignal:1.6.4], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> [batch_loader:0.1.0-beta.3], Bad dependency version for absinthe: ~> 1.4.0 or ~> 1.5.0-beta.
===> [appsignal:1.6.0-alpha.1], Bad dependency version for httpoison: ~> 0.11 or ~> 1.0.
===> Writing index to /Users/andreas/.cache/rebar3/hex/default/packages.idx
===> Package not found in registry: {<<"idna">>,<<"6.0.1">>}.
** (Mix) Could not compile dependency :hackney, "/Users/andreas/.mix/rebar3 bare compile --paths="/Users/andreas/dev-local/praxkit-org/e76d31b7_boilerplate_praxkit/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile hackney", update it with "mix deps.update hackney" or clean it with "mix deps.clean hackney"
➜  e76d31b7_boilerplate_praxkit 

1 Like

How did you install Erlang and Elixir? I highly recommend only installing them through asdf.

1 Like

I would suggest you upgrade your elixir to 1.10.x first.

One of the nice thing that get me hooked on elixir is the much smoother experience for installation and resolving dependencies than for example node.js or ruby. So I never had any problem.

My way to install erlang/elixir is very simple. I am on Debian, and Debian’s erlang package is good enough. Latest Elixir can be compiled from source with Debian supplied OTP/21 in about 1 minute on my lowest end VPS (1vcpu/1G RAM). Not many modern languages can pass this test.

1 Like

I’m on MacOS with Brew. Thanks for your advice. I’ll go for it.

mix local.rebar

made my day. After upgrading to Elixir Elixir 1.10.4 (compiled with Erlang/OTP 23)
See https://stackoverflow.com/questions/62160503/elixir-package-not-found-in-registry-hackney-problem

5 Likes