A question about using `mix deps.get`

when i use
mix deps.get
it will get like this…
** (Mix) Unknown package idna in lockfile

then after i add mix.lock file
“idna”: {:package, “1.0.1”},

then after i use same command mix deps.get
then it show like this

warning: key :idna will be overridden in map
nofile:1

warning: key :idna will be overridden in map
nofile:1

Resolving Hex dependencies…
** (Mix) Unable to find package version phoenix_html 2.11.2 in registry

Hello and welcome,

This is a versioning problem… can You show your mix.exs file to see which versions You use?

1 Like

version: 0.0.1

That is not your mix.exs file…

1 Like

this is my code

defmodule Demo.Mixfile do
  use Mix.Project

  def project do
    [
      app: :demo,
      version: "0.0.1",
      elixir: "~> 1.4",
      elixirc_paths: elixirc_paths(Mix.env()),
      compilers: [:phoenix, :gettext] ++ Mix.compilers(),
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Configuration for the OTP application.
  #
  # Type `mix help compile.app` for more information.
  def application do
    [
      mod: {Demo.Application, []},
      extra_applications: [:logger, :runtime_tools]
    ]
  end

You did not put the deps part of your mix.exs file, which is where your dependencies are defined…

1 Like
  defp deps do
    [
      {:phoenix, "~> 1.3.0"},
      {:phoenix_pubsub, "~> 1.0"},
      {:phoenix_html, "~> 2.11.2"},
      {:phoenix_live_reload, "~> 1.0", only: :dev},
      {:gettext, "~> 0.11"},
      {:cowboy, "~> 1.0"},
      {:tus, "~> 0.1.2"},
      {:tus_storage_s3, "~> 0.1.0"},
      {:tus_cache_redis, "~> 0.1.0"}
    ]
  end

This is an old version of Phoenix… depending on what You need to do You might:

  • remove _build, deps, mix.lock and try again
  • Update to latest

Are You trying to update? or rebuild? or anything else?

I would try solution 1 at first

1 Like

yeah i tried but it will showing like this

warning: key :idna will be overridden in map
nofile:1

warning: key :idna will be overridden in map
nofile:1

Resolving Hex dependencies…
** (Mix) Unable to find package version phoenix 1.4.9 in registry

If You are on a *NIX system, can You show the result of …

cat mix.lock | grep idna

The problem is with tus_storage_s3, which depends on hackney, which depends on idna

I would also try tus 0.1.3 as it is the latest…

You never edit your mix.lock by hand.

If you did some mistake while doing so, its probably damaged and hard or impossible to repair. Your best option might be to delete it and mix deps.get again to recreate it.

This will cause all currently “locked” pockages to get updated. You might want to temporarily pin the versions in your mix file tightly to the currently locked version.

2 Likes

You might also show the result of mix archive, I have the following result.

$ mix archive
* hex-0.20.1
* phx_new-1.4.9

ok…

I deleted entire project and i created new project … then it will shown like this

mix deps.get
** (Mix) Unknown package idna in lockfile

yeah i tried but it wont working

How did you create your project? After creation, do you have a mix.lock then? How does it look like? And how your mix.exs?

2 Likes

Also how did you install elixir/erlang and what versions of each are you running? That’s not a typical error message.

2 Likes

when i use mix deps.get
** (Mix) Unable to find package version phoenix 1.4.9 in registry

Could you please answer the questions asked by @axelson and me in the 2 previous posts?

2 Likes