Cannot install {:arrays, "~> 2.1"}

I am using Livebook v0.18.1 with Elixir v1.19.3

When using:

Mix.install([
  {:arrays, “~> 2.1”}
])

I get:

Resolving Hex dependencies…
Resolution completed in 0.083s
New:
arrays 2.1.1
castore 1.0.17
extractable 1.0.1
insertable 1.0.0
type_check 0.13.7

* Getting arrays (Hex package)
* Getting extractable (Hex package)
* Getting insertable (Hex package)
* Getting type_check (Hex package)
* Getting castore (Hex package)
  ==> castore
  Compiling 1 file (.ex)
  Generated castore app
  ==> type_check
  Compiling 123 files (.ex)

== Compilation error in file lib/type_check/default_overrides/regex.ex ==
** (Kernel.TypespecError) lib/type_check/default_overrides/regex.ex:5: undefined field :re_version on struct Regex
(elixir 1.19.3) lib/kernel/typespec.ex:992: Kernel.Typespec.compile_error/2
(stdlib 7.1) lists.erl:2641: :lists.foreach_1/2
(elixir 1.19.3) lib/kernel/typespec.ex:617: Kernel.Typespec.typespec/4
(elixir 1.19.3) lib/kernel/typespec.ex:312: Kernel.Typespec.translate_type/2
(stdlib 7.1) lists.erl:2673: :lists.mapfoldl_1/3
(elixir 1.19.3) lib/kernel/typespec.ex:239: Kernel.Typespec.translate_typespecs_for_module/2
could not compile dependency :type_check, “mix compile” failed. Errors may have been logged above. You can recompile this dependency with “mix deps.compile type_check --force”, update it with “mix deps.update type_check” or clean it with “mix deps.clean type_check”

error log:

** (exit) shutdown: 1
    (mix 1.19.3) lib/mix/tasks/compile.all.ex:79: Mix.Tasks.Compile.All.do_run/2
    (mix 1.19.3) lib/mix/task.ex:499: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.19.3) lib/mix/tasks/compile.ex:145: Mix.Tasks.Compile.run/1
    (mix 1.19.3) lib/mix/task.ex:499: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.19.3) lib/mix/tasks/deps.compile.ex:224: anonymous fn/2 in Mix.Tasks.Deps.Compile.do_mix/2
    (mix 1.19.3) lib/mix/project.ex:557: Mix.Project.in_project/4
    (elixir 1.19.3) lib/file.ex:2007: File.cd!/2

How do I fix this?
Thanks for your reply, Chrichton

re_version is no more as of Elixir 1.19

So the solution is either patch the library, or downgrade to 1.18

That field on the Regex struct was dropped in February:

You’ll either need to update the type_check library or use an older version of Elixir.

1 Like

Thank you for your answers.

I installed the livebook on my Mac by downloading the livebook.dmg and executing it.

Does this mean, that the .dmg has a bug???
What am I to do?

It’s a bug in the type_check package, which the arrays package depends on. These packages look a bit immature and currently are in need of updating for latest Elixir and OTP, so you may want to use some other packages instead.

2 Likes

Thanks.

That does help me