Sublime Text 3 SublimeLinter插件无法找到jshint [英] Sublime Text 3 SublimeLinter plugin not able to find jshint

查看:265
本文介绍了Sublime Text 3 SublimeLinter插件无法找到jshint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,SublimeLinter3或SublimeLinter3 JSHint linter插件似乎无法解析PATH环境变量,因此无法运行jshint:

For some reason, SublimeLinter3, or the SublimeLinter3 JSHint linter plugin, seems unable to parse the PATH environment variable and is thus unable to run jshint:

SublimeLinter: Could not parse shell PATH output:
<empty> 
error: SublimeLinter could not determine your shell PATH. It is unlikely that any linters  will work. 

Please see the troubleshooting guide for info on how to debug PATH problems.
SublimeLinter: WARNING: jshint deactivated, cannot locate 'jshint' 
Can't connect
Unable to fetch update url contents

jshint二进制文件位于PATH中,但是:

The jshint binary is in the PATH, however:

$ which jshint
/home/path/to/bin/jshint

该问题仅在Ubuntu上发生.在OS X上可以完美运行.我已经仔细阅读了官方文档

The problem only occurs on Ubuntu. Works flawlessly on OS X. I've scoured through the official docs to no avail.

如果有任何后果,请使用bash.

Using bash if that's of any consequence.

推荐答案

我最终通过打开SublimeLinter首选项并手动将路径添加到linter来解决了这个问题:

I eventually fixed this by opening up the SublimeLinter preferences and manually adding the path to the linter:

"paths": {
    "linux": ["/path/to/jshint/bin"],
    "osx": [],
    "windows": []
},

如果还没有,可以通过npm安装:

If you don't already have it, you can install via npm:

npm install -g jshint

您可以通过以下方式找到其位置:

And you find its location with:

which jshint

或在Windows中:

or in Windows:

where jshint

这篇关于Sublime Text 3 SublimeLinter插件无法找到jshint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆