简体   繁体   English

SublimeLinter:警告:jshint已停用,无法找到'jshint'

[英]SublimeLinter: WARNING: jshint deactivated, cannot locate 'jshint'

This just happened completely randomly. 这完全是随机发生的。 All I did was restart Sublime and next I know I had to re-set the path to git.exe and SublimeLinter jshint is broken. 我所做的就是重启Sublime,接下来我知道我必须重新设置git.exe的路径,并且SublimeLinter jshint被破坏了。 I've removed and re-installed SublimeLinter and SublimLinter-jshint in various orders to try to fix it. 我已经删除并重新安装SublimeLinter和SublimLinter-jshint以尝试修复它。

I also installed jshint globally with npm. 我还用npm全局安装了jshint。

SublimeLinter default/user settings: SublimeLinter默认/用户设置:

{
    "default": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "mark_style": "outline",
        "no_column_highlights_line": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": ["C:\\Users\\x\\AppData\\Roaming\\npm\\node_modules\\jshint\\bin"]
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "python django": "python",
            "html 5": "html",
            "html (django)": "html",
            "html (rails)": "html",
            "php": "html"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}

console: 安慰:

SublimeLinter: jshint linter loaded 
reloading plugin SublimeLinter.commands
reloading plugin SublimeLinter.sublimelinter
plugins loaded
SublimeLinter: debug mode: on 
SublimeLinter: temp directory: c:\users\x\appdata\local\temp\SublimeLinter3 
SublimeLinter: computed PATH from system:
C:\Users\x\AppData\Roaming\npm\node_modules\jshint\bin
C:\Program Files\Common Files\Microsoft Shared\Windows Live
C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Program Files\ThinkPad\Bluetooth Software\
C:\Program Files\ThinkPad\Bluetooth Software\syswow64
C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
C:\Program Files (x86)\Common Files\Lenovo
C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\
C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\
C:\Program Files (x86)\Lenovo\Access Connections\
C:\Program Files\Common Files\Lenovo
C:\Program Files (x86)\Lenovo\Client Security Solution
C:\Program Files\Lenovo\Client Security Solution
C:\Program Files (x86)\OpenLDAP\kfw\Binary
C:\Program Files (x86)\Windows Live\Shared
C:\Program Files\Microsoft\Web Platform Installer\
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
C:\PROGRA~1\IBM\SQLLIB\BIN
C:\PROGRA~1\IBM\SQLLIB\FUNCTION
C:\Program Files\nodejs\
C:\Python27

SublimeLinter: WARNING: jshint deactivated, cannot locate 'jshint' 
SublimeLinter: found existing HTML syntax, version 3 
SublimeLinter: found existing Rails syntax, version 1 
found 3 files for base name Main.sublime-menu
Package Control: Skipping automatic upgrade, last run at 2014-07-30 10:51:51, next run at 2014-07-30 11:51:51 or after

According to the SublimeLinter documentation , it requires you to have linter executables in your path. 根据SublimeLinter文档 ,它要求您在路径中包含linter可执行文件。

Most linter plugins require you to install a linter binary or library and configure your PATH so that SublimeLinter can find it. 大多数linter插件都要求您安装linter二进制文件或库并配置PATH,以便SublimeLinter可以找到它。 You must follow the linter plugin's installation instructions to successfully use it. 您必须按照linter插件的安装说明成功使用它。

Have you tried opening a terminal window and seeing what happens if you type jshint --version ? 您是否尝试打开终端窗口,看看如果键入jshint --version会发生什么? You should see something like jshint v2.5.0 as a response if it's already in your path. 如果jshint v2.5.0已经在您的路径中,您应该会看到类似jshint v2.5.0的内容。

Also, if you're like me, and can't modify your Windows PATH variables due to workplace restrictions, you can add the path to the Default and User settings like I did here Comment on SublimeLinter . 此外,如果您像我一样,并且由于工作场所限制而无法修改Windows PATH变量,则可以像我在此处所做的那样添加默认用户设置的路径评论SublimeLinter This worked for Sublime 3 build 3065. 这适用于Sublime 3 build 3065。

{
    "default": {
        "debug": false,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "mark_style": "outline",
        "no_column_highlights_line": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": ["C:/Users/myUserName/AppData/Roaming/npm"]
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "python django": "python",
            "html 5": "html",
            "html (django)": "html",
            "html (rails)": "html",
            "php": "html"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}

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

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