JShint not working

为君一笑 提交于 2019-12-11 02:09:52

问题


I installed jshint using npm install -g jshint. I'm not sure if there is a problem with my node installation or what but when in the terminal and I run jshint it doesn't do anything. It doesn't show anything but a blank line them the next terminal prompt comes up. After a new install of node after having previous troubles after an upgrade when I ran the npm install -g jshint command it didn't look like it ran like it usually does. Here is the output from trying to install jshint.

$ npm install -g jshint
/Users/michael/.nvm/v0.10.32/bin/jshint -> /Users/michael/.nvm/v0.10.32/lib/node_modules/jshint/bin/jshint
jshint@2.5.6 /Users/michael/.nvm/v0.10.32/lib/node_modules/jshint
├── strip-json-comments@1.0.1
├── underscore@1.6.0
├── exit@0.1.2
├── shelljs@0.3.0
├── console-browserify@1.1.0 (date-now@0.1.4)
├── minimatch@1.0.0 (sigmund@1.0.0, lru-cache@2.5.0)
├── htmlparser2@3.7.3 (domelementtype@1.1.1, domutils@1.5.0, entities@1.0.0, domhandler@2.2.0, readable-stream@1.1.13)
└── cli@0.6.4 (glob@3.2.11)

回答1:


Your installation seems fine.

To use it, simply type:

jshint yourfile.js

You can also use it for a whole directory. For example, to use it in the current directory:

jshint .

If JSHint doesn't find any errors, it doesn't output anything. So that might be the "problem" here.




回答2:


An uninstall of my node_modules and reinstall seemed to fix my problem.



来源:https://stackoverflow.com/questions/26345412/jshint-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!