Question

I have the latest version of Emacs and Tern but I have a problem with using the plugin. When I use any Tern-related commands I get this command from editor:

Wrong type argument: listp, "Could not start Tern server
env: node: No such file or directory.
"

As far as I know, Tern uses NodeJs to do it's job, I have the latest version of NodeJs also but I don't know why I get this error.

Was it helpful?

Solution

Add the following line to your init file, replacing the path for node if necessary depending on where node is installed:

(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))

OTHER TIPS

I used to have the same problem and just make it work. The thing is that the plugin have hard coded tern-command path. So I modify the path to "/usr/local/bin/tern".

And because I install the plugin with emacs 24's package, I have to delete tern.elc in the plugin folder and recompile it by C-u 0 M-x byte-recompile-directory.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top