简体   繁体   English

tern_for_vim(ternjs)返回403访问被拒绝

[英]tern_for_vim (ternjs) returns 403 access denied

Trying to get JavaScript completion working in MacVim, using YouCompleteMe + TernJS . 尝试使用YouCompleteMe + TernJS在MacVim中完成JavaScript的工作。

I've followed the install instructions for both plugins (I use Vundle to manage vim plugins), which included running ./install.sh script inside the YCM plugin folder, and npm install inside the TernJS plugin folder. 我已经遵循了两个插件的安装说明(我使用Vundle来管理vim插件),其中包括在YCM插件文件夹中运行./install.sh脚本,以及在TernJS插件文件夹中npm install Installation of both appears to have completed successfully. 两者的安装似乎已成功完成。

However I'm not getting any JS completions as I type; 但是,我键入时没有得到任何JS补全; and if I try to manually trigger something in TernJS (eg. :TernDef ), I get a HTML error page back from the local TernJS server, indicating a 403 Access Denied error. 如果我尝试手动触发TernJS中的某些内容(例如:TernDef ), :TernDef从本地TernJS服务器返回HTML错误页面,指示403 Access Denied错误。

If I launch MacVim with sudo (eg. sudo mvim ); 如果我使用sudo启动MacVim(例如sudo mvim ); everything seems to work fine. 一切似乎都正常。

Also, without sudo, I can manually post a JSON document to the TernJS server (outside of vim) and get a valid response back. 另外,没有sudo,我可以手动将JSON文档发布到TernJS服务器(在vim之外)并获得有效的响应。

I'm running MacVim 7.4.71 (installed via Homebrew; compiled with python support ), and node 0.10.21 (also installed via Homebrew). 我正在运行MacVim 7.4.71(通过Homebrew安装;通过python support编译)和节点0.10.21(也通过Homebrew安装)。

Any ideas on what I could check, so that I can have TernJS completions without needing to use sudo to launch MacVim? 关于我可以检查的内容有什么想法,以便无需使用sudo启动MacVim就可以完成TernJS?

Figured it out. 弄清楚了。

My shell profile was setting the $http_proxy env variable so the requests from MacVim to the local TernJS server were trying to go out through a proxy server. 我的shell配置文件设置了$http_proxy env变量,因此从MacVim到本地TernJS服务器的请求正尝试通过代理服务器发出。

Fixed by adding export no_proxy=localhost to my shell profile, so that requests to http://localhost don't use a proxy. 通过在我的外壳配置文件中添加export no_proxy=localhost来解决,以使对http://localhost请求不使用代理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM