Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mix deps.get fails (dependency issue)

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!

like image 317
Charles Schleich Avatar asked Dec 15 '16 13:12

Charles Schleich


1 Answers

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
like image 109
Charles Schleich Avatar answered Nov 02 '22 04:11

Charles Schleich