Life & Note

emacs exec-path is not synced with $PATH under MacOS

I do not notice this issue when I try to use the npm from emacs eshell.
I found that the npm can be found from bash in iTerm2 but cannot be found from emacs eshell.
Then I notice that the emacs do not sync the interal PATH with what you can check from bash.

I fact the wiki already mentioned those issues here.
And also, you can find from the stackoverflow with the same question.

Here I want to tell a good package for emacs from stackoverflow:
exec-path-from-shell

With simple setup, you path could be right:

1
2
3
(require 'exec-path-from-shell)
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))

Enjoy emacs.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please refer to the author's name `winterTTr` when you remix, transform, and build upon this material.

本作品由winterTTr创作,采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。修改,参照或者转载请注明作者winterTTr

坚持原创技术分享,您的支持将鼓励我继续创作!