I've got Node installed using NVM, and Emacs (v25.2.1) isn't able to find Node. When I run M-: (executable-find "node")
I get back nil
.
However, when I run M-: (executable-find "cat")
I get "/bin/cat"
. I assume the difference is due to my use of NVM.
How do I get Emacs to find Node when I've got Node installed using NVM?
Incidental technical details:
My Emacs was installed using MacPorts (using the emacs-app
package that installs to the Mac Applications folder for a GUI experience), and I've got the following lines in my ~/.bashrc
:
export NVM_DIR="/Users/fred/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
My ~/.bash_profile
contains source ~/.bashrc
.
I'm not sure if this is relevant to the problem, but I should mention that when I open M-x eshell
, I get the following when trying to run Node:
$ node
node: command not found
However, I am able to run Node through M-x shell
.
I did have limited success installing the emacs
package (as opposed to the emacs-app
package) from MacPorts. Using the Emacs from the emacs
package (which installs to /opt/local/bin/emacs), I was able to evaluate in the scratch buffer:
(executable-find "node")
And successfully got the path to node. However, this same lisp expression evaluated in the Emacs from the emacs-app
package yielded nil
. This doesn't help me much, because I want to use the emacs from emacs-app
, because it's the Emacs with the graphical interface for Mac, as I understand it.
I want to continue using NVM, please.