简体   繁体   English

JShint不起作用

[英]JShint not working

I installed jshint using npm install -g jshint. 我使用npm install -g jshint安装了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. 我不确定我的节点安装是否有问题或什么问题,但是在终端中运行jshint时它什么也没做。 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. 在运行npm install -g jshint命令后,在升级之前遇到了麻烦之后,重新安装了节点之后,它看起来不像通常那样运行。 Here is the output from trying to install jshint. 这是尝试安装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)

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. 如果JSHint没有发现任何错误,则不会输出任何内容。 So that might be the "problem" here. 因此,这可能是这里的“问题”。

卸载我的node_modules并重新安装似乎可以解决我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM