This is a strange situation right here.
I installed phx.new app --live, ecto.create, all default phx.new 1.6.2 dependencies.
I want to install phx_gen_auth, added {:phx_gen_auth, “~> 0.7”, only: [:dev], runtime: false} to mix.exs, but get an error:
mix deps.get
Resolving Hex dependencies…
Failed to use “phoenix” (version 1.6.2) because
phoenix_live_reload (versions 1.2.0 to 1.3.3) requires ~> 1.4
phoenix_live_view (versions 0.16.0 to 0.16.4) requires ~> 1.5.9 or ~> 1.6.0
phx_gen_auth (version 0.7.0) requires ~> 1.5.2
mix.exs specifies ~> 1.6.2
Well phoenix is already 1.6.2, why do I get this error?
The good news is that the Phoenix auth generators were merged into Phoenix 1.6. So, you can just run the phx.gen.auth commands without installing any extra deps. I assume that trying to install the separate package intentionally throws an error for versions above 1.5.
Check out the changelog on GitHub. Big kudos to the Phoenix team for providing very clear details on the updates and changes for each release - I’m sure that is a monumental task in addition to maintaining the entire framework.
It is very comprehensive, but it is definitely easy to miss.