简体   繁体   中英

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!

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM