BEAM file compliation error after degrading Erlang version from 22 to 21

I have followed this StackOverflow post to install the specific version of Erlang.

And When I am running mix ecto.setup then getting following error-

Error loading module telemetry_handler_table:
  This BEAM file was compiled for a later version of the run-time system than 21.
  To fix this, please recompile this module with an 21 compiler.

When running iex command, following version I am getting-

Erlang/OTP 21 [erts-10.3.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

Interactive Elixir (1.8.2)
1 Like

Have you purged your deps and _build folders after changing the erlang/elixir version?

2 Likes

No, I don’t know how to do. I have only done those mentioned steps.

Using regular rm -rf deps _build from within your project root or a graphical file manager if you prefer GUIs.

25 Likes

Thanks for the solution.