【问题标题】:Could not start Tern server in Emacs无法在 Emacs 中启动 Tern 服务器
【发布时间】:2013-08-07 12:00:17
【问题描述】:

我有最新版本的 Emacs 和 Tern,但我在使用插件时遇到了问题。当我使用任何与 Tern 相关的命令时,我会从编辑器中获取此命令:

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

据我所知,Tern 使用 NodeJs 来完成它的工作,我也有最新版本的 NodeJs,但我不知道为什么会出现此错误。

【问题讨论】:

  • “node”是否在路径上可执行? Emacs 似乎在抱怨这一点。
  • @juanleon 我可以在 bash 中运行node 命令。
  • 你解决了吗?前段时间我也遇到过类似的问题,我通过从命令行启动 emacs 解决了。
  • @AlbertoZaccagni 不,我没有!怎么样?
  • 打开外壳并运行nohup emacs &

标签: node.js emacs tern


【解决方案1】:

将以下行添加到您的 init 文件中,如有必要,根据节点的安装位置替换节点的路径:

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

【讨论】:

  • 在命令行可以通过which node找到node的路径。
【解决方案2】:

我曾经有同样的问题,只是让它工作。问题是插件有hard coded tern-command path。所以我将路径修改为“/usr/local/bin/tern”。

而且因为我是用emacs 24的包安装插件的,所以我得把插件文件夹里的tern.elc删除,用C-u 0 M-x byte-recompile-directory重新编译。

【讨论】:

    猜你喜欢
    • 2011-08-05
    • 2014-12-12
    • 1970-01-01
    • 1970-01-01
    • 2017-04-23
    • 2019-03-28
    • 1970-01-01
    • 2019-07-20
    • 1970-01-01
    相关资源
    最近更新 更多