Re: Emacs: Could not start Tern server

328 views
Skip to first unread message

Brady Trainor

unread,
Nov 27, 2014, 2:44:31 PM11/27/14
to tern...@googlegroups.com, Andres

Andres <a.sa...@gmail.com> writes:

> Yes it does, it returns
>
> ~/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
>
> which is what I have PATH set to for non-root users in /etc/profile,
> and which is what M-x describe-variable exe-path returns. Again the
> thing that confuses is that I can run node by simply typing node in
> the terminal, so the terminal clearly has no problem finding it in ~
> /local/bin.
>
> On Tuesday, 21 January 2014 18:21:29 UTC+10:30, Marijn Haverbeke
> wrote:
>
> That's odd. It does find the tern server script (which is where it
> is
> getting the /usr/bin/env), but somehow at that point does not have
> your ~/local/bin in its path. Does M-x getenv PATH also give you
> the
> right path?
>
> On Tue, Jan 21, 2014 at 6:19 AM, Andres <a.sa...@gmail.com> wrote:
> > Hi all,
> >
> > I'm trying to get Tern to play with Emacs. When I press M-tab to
> trigger
> > auto-completion, I get the following error:
> >
> >> Request failed: Could not start Tern server
> >>
> >> /usr/bin/env: node: No such file or directory
> >
> >
> > My node exe is in ~/local/bin, which I have added to the front
> of PATH and
> > when I query exec-path I also get ~/local/bin at the front. I
> can run node
> > by typing node in the terminal. I'm not sure what's failing at
> this point; I
> > found where the error message lives in tern.el, but I can't read
> elisp, so
> > I'm stuck. I'm running Emacs version 24.3.50.1 and the latest
> version on
> > node.
> >
> > Thanks in advance for suggestions.
> >
> > --
> > You received this message because you are subscribed to the
> Google Groups
> > "tern-dev" group.
> > To unsubscribe from this group and stop receiving emails from
> it, send an
> > email to tern-dev+u...@googlegroups.com.
> > For more options, visit
> https://groups.google.com/groups/opt_out.

I am having a similar problem. These are my attempts:

> From the documentation at http://ternjs.net/doc/manual.html#emacs, I read:

The Emacs mode uses the bin/tern server, ...

If I open up the package (C-h P tern RET etc.), and do a word search
in "tern.el" for /bin, it seems the package will only look for
"/bin/tern".

I will try a shortcut. From "/usr/local/bin/tern" to "/bin". But this
does not work. By the way, "/usr/local/bin/tern" is itself a shortcut
to "/usr/local/lib/node_modules/tern/bin/tern".

Everything looks tricky to me. There is a line in tern.el which speaks
of a location "../bin/". Relative to where? The tern file also has
similar, where it mentions a "../lib/tern". But where I think that
should be, I only find a "lib/tern.js". Very confused, I don't really
know how this stuff works.

Personally, I installed tern.el from elpa, so it is in my
"~/.emacs.d/elpa/". I don't know if this is compatible with the
author's setup.

By the way, I used =sudo apt-get install npm= and =sudo npm install -g
tern= to install tern.

If these locations (of tern) are the issue, is there some way to make
this work by exposing variables for the paths in the Emacs init file?

--
Brady

Reply all
Reply to author
Forward
0 new messages