I've been unable to run the elixir shell using alchemist-iex-run because the erlang executable erl is not found in my path. Here's the error:

/opt/homebrew/Cellar/elixir/1.12.1/bin/elixir: line 230: exec: erl: not found
Process Alchemist-IEx exited abnormally with code 127

In an attempt to fix this, in init.el I added:

(add-to-list 'exec-path "/opt/homebrew/bin")
(add-to-list 'exec-path "/opt/homebrew/sbin")

But this still doesn't work. Here's the result from...

vterm echo $PATH: Includes the added homebrew paths.

(exec-path): Includes the added homebrew paths.

(call-process "ENV" nil t): Does not include the added homebrew paths.

Erlang shell: os:cmd("echo $PATH").: Does not include the added homebrew paths, but includes path to erl at /opt/homebrew/Cellar/erlang/24.0.2_1/lib/erlang/erts-12.0.2/bin.

How to correctly set the path so that the added homebrew paths always appear?

1 Answer 1


exec-path is where Emacs looks for executables. The PATH environment variable is... well, an environment variable.

If you want to change the environment that Emacs passes to sub-processes, see the process-environment variable and setenv function.

See also C-hig (elisp)System Environment

I'm extremely surprised if vterm is adding exec-path to PATH. It's probably considered a feature rather than a bug, but it's not normal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.