How to use JSHint in Sublime Text on Windows machine
Since this is in the “quick tips” category I won’t go into what Sublime Text is, or why using JSHint is recommended, and that for it’s installation you need Node.js, I will just state the shortest possible path in how to install it, as I had some problems in doing this in a timely fashion:
//install jshint via npm npm install jshint -g
In Sublime Text install JSHint Gutter via package manager.
And now, finally, since I’m on a windows machine, the problem was that once I got all this installed I had to set the Node.js path in JSHint Gutter plugin but with setting the absolute path to node.exe by using forward slashes:
{ // Simply using `node` without specifying a path sometimes doesn't work :( // https://github.com/victorporof/Sublime-JSHint#oh-noez-command-not-found // http://nodejs.org/#download "node_path": "C:/Program Files/nodejs/", // Automatically lint on edit (Sublime Text 3 only). "lint_on_edit": false, // Automatically lint when a file is saved. "lint_on_save": true, // Highlight problematic regions when selected. "highlight_selected_regions": false }
Thanks for the tip. I ran npm install jshint -g then in Sublime Text 3 I installed via packackamanager I installed JSHint Gutter. It worked as a charm. I did not have to fix the path it was already set in JSHint.sublime-settings to: “node_path”: {
“windows”: “C:/Program Files/nodejs/node.exe”,
“linux”: “/usr/bin/nodejs”,
“osx”: “/usr/local/bin/node”
},
Hi Patrik,
It could be that they changed the defaults since the version that I was using.
Thanks for the update!
Pretty great post. I simply stumbled uon your blog and wished to mention that I’ve truly loved surfing around your bllog
posts. After all I’ll be subscribing for your feed and I hope you
write once more soon!