Sublime Forum

Do I need to run: 'npm install -g jshint'?

#1

After following installation instructions, I get the following console message on opening a JavaScript file:

SublimeLinter: user shell: /bin/bash
SublimeLinter: computed PATH using /bin/bash:
/Library/Frameworks/Python.framework/Versions/3.5/bin
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/opt/X11/bin
/Library/Frameworks/Python.framework/Versions/3.5/bin

SublimeLinter: WARNING: jshint deactivated, cannot locate ‘’

The package was successfully installed here:
~/Library/Application Support/Sublime Text 3/Installed Packages/SublimeLinter-jshint.sublime-package.

Do I bow need to run: ‘npm install -g jshint’?

Thanks in anticipation.

-u

0 Likes

#2

I would assume that the most likely solutions to your problem are:

  1. Add the location that your currently installed copy of jshint is installed in to the path so that it will be found
  2. Install jshint if it’s not already installed, and if that doesn’t work, see step #1

Do you currently have any versions of jshint installed?

0 Likes

#3

I don’t understand.
I thought I had just installed it for ST.
I have no idea where it is, or what to look for it other than as aforesaid.
Thanks.
-u

0 Likes

#4

Sublimelinter-jshint just interfaces with jshint. You still need to install that on your system, as is explicitly mentioned in the Readme.

0 Likes

#5

Although there may be some packages that prove the exception to the rule, generally speaking packages for Sublime that require external tools in order to work require you to install them yourself, and they just provide the glue layer between the external tool and Sublime.

If they tried to install everything you needed, things would quickly spiral out of control (e.g. it would also have to determine where npm was in order to install jshint, which might require it to install node on your machine, which would require it to ask you where you’d like to install it, and all of that work has already been done by the people that make node).

In particular, the documentation for SublimeLinter-jshint says:

Before installing this plugin, you must ensure that jshint (2.5.0 or later) is installed on your system.
To install jshint, do the following:

  1. Install Node.js (and npm on Linux).

  2. Install jshint by typing the following in a terminal:

npm install -g jshint

[ :scissors: … snip … :scissors: ]

In order for jshint to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. The docs cover troubleshooting PATH configuration.

0 Likes

#6

@FichteFoll & @FichteFoll

I followed these instructions: http://www.sublimelinter.com/en/latest/installation.html# Revision 15bb4a2e.
They do not appear to me to say anything about installing jshint globally.

All is working now.

0 Likes