"module Hex.Crypto is not available" when publishing a package to Hex.pm

79 views Asked by At

On attempting to run hex.publish to publish my package to Hex, I receive the following output and traceback:

~/Source/example_app main
nix-shell ❯ MIX_ENV=docs mix hex.publish
Building example_app 1.0.0
  App: example_app
  Name: example_app
  Files:
    <snip>
  Version: 1.0.0
  Build tools: mix
  Description: Example description
  Licenses: MIT
  Links:
    GitHub: https://github.com/xxx/yyy
  Elixir: ~> 1.7
Before publishing, please read the Code of Conduct: https://hex.pm/policies/codeofconduct

Publishing package to public repository hexpm.

Proceed? [Yn]
Building docs...
Generated example_app app
Generating docs...


View "epub" docs at "doc/example_app.epub"
Local password:
** (UndefinedFunctionError) function Hex.Crypto.decrypt/3 is undefined (module Hex.Crypto is not available)
    (hex 2.0.0) Hex.Crypto.decrypt("<snip key>", "<snip local password>", "HEXAPIKEY")
    (hex 2.0.0) lib/mix/tasks/hex.ex:317: Mix.Tasks.Hex.prompt_decrypt_key/2
    (hex 2.0.0) lib/mix/tasks/hex.ex:263: Mix.Tasks.Hex.auth_info/2
    (hex 2.0.0) lib/mix/tasks/hex.publish.ex:147: Mix.Tasks.Hex.Publish.create/3
    (mix 1.15.0) lib/mix/task.ex:447: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.15.0) lib/mix/cli.ex:92: Mix.CLI.run_task/2

How do I solve this?

1

There are 1 answers

0
Darian Moody On

Ensure Hex is installed & updated, and re-run the publish.

mix local.hex --force
mix hex.publish

You do not need to specify it as a dependency of your application.