mix deps.get fails (dependency issue)
Asked Answered
T

2

11

i'm quite new to elixir and phoenix (and ubuntu) and have been battling to get myself up and running with web development. upon creating a new phoenix application using

mix phoenix.new webapp

i get the following errors from terminal

Fetch and install dependencies? [Yn] y
* running mix deps.get
* error command failed to execute, please run the following command again after installation: "mix deps.get"
* running npm install && node node_modules/brunch/bin/brunch build
* error command failed to execute, please run the following command again after installation: "npm install && node node_modules/brunch/bin/brunch build"

and when running mix deps.get

the resultant error message is

** (Mix) No package with name phoenix_ecto (from: mix.exs) in registry

I'm still quite new when it comes to using this platform, so i'm not entirely sure how to pull/get/place/download the phoenix_ecto package in the registry. From what i understand this is all handled by hex package manager.

I did manage to get phoenix up and running a few days ago, and managed to play around a little bit with developing small test applications. but it seems somewhere in my reckless terminal sudoing i managed to break something somewhere.

some extra information

Elixir 1.3.4
Mix 1.3.4
npm 3.5.2
node v4.2.6
Phoenix v1.2.1

If any other information is required i will happily provide!

Thursday answered 15/12, 2016 at 13:56 Comment(2)
That's an odd error. Yes phoenix_ecto should be handled by hex. If I were you I'd try adding the dependency directly to your mix file if it's not already there. Like so: {:phoenix_ecto, "~> 3.1.0-rc.0"}Samuel
i checked my mix.exs file and the dependency was already as {:phoenix_ecto, "~> 3.0"}Thursday
T
11

I managed to fix the error by unlocking the dependencies and updating them. the commands are below.

mix deps.unlock --all
mix deps.update --all

Now the projects are created and build no problem. Hope this helps someone.

Edit 1:

If the above does not work, there is the possibility that your hex install has been corrupted. This was my case about a week after the original post. Can be fixed by removing hex and reinstalling.

rm -rf ~/.mix/archives/hex-0.15.0
mix local.hex

your hex version may be different from mine.

hex-0.xx.x
Thursday answered 15/12, 2016 at 15:0 Comment(1)
I was just about to suggest insuring that your dependencies were all unlocked. Glad you found it yourself.Samuel
P
0

This may appear in several cases. First check you mix.exs deps section. Ensure phoenix_ecto placed with right version and opts. Further you need check phoenix_ecto from local just clone repo and set {:phoenix_ecto, path: "..."}in you project. Try to compile local. If it compiles local and not compiles in deps check phoenix_ecto mix.exs file and defp package method and ensure that return list with mix.exs [_, .., file: ~w{mix.exs}, _].

In common this problem relate to mix.exs.

Phlebotomize answered 17/12, 2016 at 20:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.