Skip to content

Commit

Permalink
Don't rely on 'nodejs' and 'node' being in PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
victorporof committed Oct 27, 2014
1 parent 3fb3c31 commit 4256332
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions JSHint.py
Expand Up @@ -274,16 +274,10 @@ def exists_in_path(cmd):

@staticmethod
def get_node_path():
# Simply using `node` without specifying a path sometimes doesn't work :(
if PluginUtils.exists_in_path("nodejs"):
return "nodejs"
elif PluginUtils.exists_in_path("node"):
return "node"
else:
platform = sublime.platform()
node = PluginUtils.get_pref("node_path").get(platform)
print("Using node.js path on '" + platform + "': " + node)
return node
platform = sublime.platform()
node = PluginUtils.get_pref("node_path").get(platform)
print("Using node.js path on '" + platform + "': " + node)
return node

@staticmethod
def get_output(cmd):
Expand Down

2 comments on commit 4256332

@kjlubick
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should update the readme to say something to the point that users must specify where node is (although the program will try the default installation locations), because the path is no longer searched.

@victorporof
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's going to be a popup advising them to do so if the default path isn't working.

Please sign in to comment.