1

I have installed jshint globally by using this command

npm install -g jshint

It installed perfectly but is showing me error while I am trying to run this

jshint app.js

then this is showing me error that jshint is not recognized as an internal or external command, operable program or batch file.

Kunal Nischal
  • 64
  • 2
  • 6
  • How can i check path? can you please help – Kunal Nischal Jan 03 '17 at 06:30
  • On windows, in a command window, type `echo %PATH%`. It should include the directory where npm stores its globally installed modules. For more information, google "path npm windows". –  Jan 03 '17 at 06:34

1 Answers1

7

Your PATH may be missing the directory that contains the executable. I installed it locally,

$ npm install jshint

I would have to call it from the .bin directory in the node_modules directory, like this:

$ node_modules/.bin/jshint js_file_test.js

If you install it globally, with the -g flag, then you will be able to run it from anywhere as long as the path to your npm modules in in your path. To check the path from the command line, run:

$ echo %PATH%

As an example, the path to my copy of the jshint executable (jshint.cmd) is located in C:\Users\Paul\AppData\Roaming\npm. That directory is in my path so I can run jshint from anywhere.

ppovoski
  • 4,553
  • 5
  • 22
  • 28