Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3 SublimeLinter plugin not able to find 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

The jshint binary is in the PATH, however:

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

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

Using bash if that's of any consequence.

like image 487
jdlm Avatar asked Jan 07 '14 07:01

jdlm


1 Answers

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": []
},

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

npm install -g jshint

And you find its location with:

which jshint

or in Windows:

where jshint
like image 196
jdlm Avatar answered Oct 08 '22 03:10

jdlm