JShint不起作用 [英] JShint not working

查看:60
本文介绍了JShint不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用npm install -g jshint安装了jshint.我不知道我的节点安装是否有问题,或者什么,但是在终端中运行jshint时它什么也没做.它没有显示任何内容,但在下一个终端提示出现时会显示空白行.在运行npm install -g jshint命令后,在升级之前遇到了麻烦之后,重新安装了节点之后,它看起来不像通常那样运行.这是尝试安装jshint的输出.

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)

推荐答案

您的安装似乎正常.

要使用它,只需键入:

jshint yourfile.js

您也可以将其用于整个目录.例如,要在当前目录中使用它:

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

jshint .

如果JSHint没有发现任何错误,则不会输出任何内容.所以这可能是这里的问题".

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

这篇关于JShint不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆