1
votes

I have a very simple project and I am trying to publish the first version to hex. However I cannot run the hex.publish task.

I get the error ** (Mix) The task "hex.publish" could not be found.

I am following these hex instructions.

My mix.exs file looks like the following.

defmodule Ace.Mixfile do
  use Mix.Project

  def project do
    [app: :ace,
     version: "0.2.0",
     elixir: "~> 1.0",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps]
  end

  def application do
    [
      applications: [:logger],
      mod: {Ace, []}
    ]
  end

  defp deps do
    []
  end
end
1
Do you have hex installed? Try running mix local.hex and then mix hex.publish. - Dogbert
@Dogbert You should post that as an answer in case anyone else runs across this. - Onorio Catenacci
@OnorioCatenacci I was waiting for OP to confirm :) - Dogbert
yep that was what I needed. - Peter Saxton

1 Answers

4
votes

You might not have hex installed. According to hex usage, please use

mix local.hex

in your terminal or CMD console. Then mix hex.publish should work.