How do I specify the path to node in SublimeText3 for Sublime-JSHint plugin in Windows
18,343
Solution 1
This works for me:
"node_path": "C:/Program Files/nodejs/node.exe"
Solution 2
Try using
"node_path": "/c/Program Files/nodejs/node.exe"
and make sure this option is in your Packages/User/JSHint.sublime-settings
file. I'm not sure why your last setting didn't work, because it is also in a valid format, but hopefully using the Cygwin-style path will work.
Related videos on Youtube
Author by
plainflavour
Updated on June 04, 2022Comments
-
plainflavour almost 2 years
After installing node.js then the Sublime-JSHint plugin on Windows XP with SublimeText3, I get the following error:
"Node.js was not found in the default path. Please specify the location."
This is a known configuration issue and is documented by the author, however I can't work out how to specify the path. Can anyone tell me how to specify the path in Windows XP?
https://github.com/victorporof/Sublime-JSHint#oh-noez-command-not-found
I have tried
"node_path": "/Program Files/nodejs", "node_path": "C:/Program Files/nodejs", "node_path": "/Program Files/nodejs/node.exe", "node_path": "C:/Program Files/nodejs/node.exe",
-
plainflavour over 10 yearsThis looked promising but I'm still getting the same error. I tried creating Packages/User/JSHint.sublime-settings, but whenever I get the error, clicking OK opens Packages/JSHint Gutter/JSHint.sublime-settings. I have tried commenting out the node_path line within that file and also deleting it altogether. Thanks for trying though
-
MattDMo over 10 years@plainflavour here's another option - adding the path to node to your Windows
PATH
variable. Right-click on My Computer, select Properties, go to the Advanced tab, click on the Environment Variable button, then find the PATH variable and click Edit. Go to the very end of what's already there, and after the last entry add;C:\Program Files\nodejs
(make sure to include the;
). Click OK, then restart Sublime and see if it works now... -
plainflavour over 10 yearsHi thanks again for your help. I've tried this, but still no use. I've also reinstalled node and the JSHint plugin but I guess it just doesn't work in XP.
-
MattDMo over 10 yearsThat sucks. If it's any consolation, SublimeLinter3 is well on its way towards being released for ST3, and it includes (or included) JSHint by default. If you absolutely need it, and can't find another plugin, you could always downgrade to Sublime Text 2 and use SublimeLinter...
-
plainflavour over 10 yearsGreat, I'll look out for that. Hopefully I'll get a new computer before that though!
-
Lars Gyrup Brink Nielsen over 10 yearsThank you, remembering to add
node.exe
did the trick for me as well :-) -
Ben over 10 yearsI also found that changing the path and saving the config required a restart of sublime.