我一直在试图使用jshint咕噜模块来验证我的代码,但我总是得到以下错误:grunt-contrib-jshint警告:路径必须是字符串;
Running "jshint" task
[D] Task source: C:\Coursera\03. Intro Angular JS\conFusion\node_modules\grunt-contrib-jshint\tasks\jshint.js
Running "jshint:all" (jshint) task
[D] Task source: C:\Coursera\03. Intro Angular JS\conFusion\node_modules\grunt-contrib-jshint\tasks\jshint.js
Verifying property jshint.all exists in config...OK
Files: Gruntfile.js, app/scripts/app.js
Options: force=false, reporterOutput=null, jshintrc=".jshintrc", reporter={}
Warning: Path must be a string. Received { toString: [Function], reporter: [Function] } Use --force to continue.
的问题是,即使使用--verbose和-debug,它不显示任何工作的错误,只是“路径必须是一个字符串”,我用JSLint(使用括号)验证文件,它工作得很好,网站也正常工作。
到目前为止我做了什么。
- Unistalled node.js和节点模块3次(每次尝试不同的东西)。
- 试图限制我的咕噜任务,只是验证一个非常简单的js文件,也没有工作,这意味着这与代码或我的gruntfile.js无关。
Gulp似乎是构建解决方案的更好选择,它比Grunt更简单快捷; – minimalistix
你正在运行什么版本的节点?我刚刚更新到6,我得到这个错误。 – keepitreal