Gruntjs Grunt错误:任务目录";任务“;找不到

Gruntjs Grunt错误:任务目录";任务“;找不到,gruntjs,Gruntjs,当我试图在OS X Mavericks 10.9终端中通过输入Grunt并返回来运行Grunt时,我收到以下错误消息: >> Tasks directory "tasks" not found. Running "jshint:all" (jshint) task ERROR: Can't find config file: .jshintrc Jim-MacBookPro:MyDirectory jmpreston$ grunt >&

当我试图在OS X Mavericks 10.9终端中通过输入Grunt并返回来运行Grunt时,我收到以下错误消息:

    >> Tasks directory "tasks" not found.

    Running "jshint:all" (jshint) task
    ERROR: Can't find config file: .jshintrc
    Jim-MacBookPro:MyDirectory jmpreston$ grunt
    >> Tasks directory "tasks" not found.
如果输入grunt-tasks,我会看到以下内容以及上面的tasks目录错误:

    TypeError: Arguments to path.join must be strings
        at path.js:360:15
        at Array.filter (native)
        at Object.exports.join (path.js:358:36)
        at Object.file.exists
    (/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/file.js:373:28)
        at task.loadTasks 
    (/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/task.js:364:18)
        at Array.forEach (native)
        at Task.task.init
    (/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/task.js:450:33)
        at Object.grunt.tasks
    (/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt.js:113:8)
        at Object.module.exports [as cli]        
    (/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/cli.js:38:9)
        at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:45:20)
TypeError:path.join的参数必须是字符串
在path.js:360:15
at Array.filter(本机)
在Object.exports.join(path.js:358:36)
位于Object.file.exists
(/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/file.js:373:28)
在task.loadTasks
(/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/task.js:364:18)
at Array.forEach(本机)
在Task.Task.init
(/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/task.js:450:33)
在Object.grunt.tasks
(/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt.js:113:8)
在Object.module.exports[作为cli]
(/Applications/MAMP/htdocs/MyDirectory/node_modules/grunt/lib/grunt/cli.js:38:9)
反对。(/usr/local/lib/node_modules/grunt cli/bin/grunt:45:20)
Grunt似乎明白,它需要查看/node_模块/文件夹以及原始安装中存在的模块/文件夹。我在指南针和地基5上安装了咕噜。原始安装中没有任务文件夹。我查了Grunt文档,在网上搜索,没有任何帮助。一个人在Stack Overflow上提到他有这个问题,然后回答说他没有说明如何解决

grunt cli v0.1.13

我不是一个很好的程序员,但通常可以阅读和破解js和php。这是我第一次来基金会/罗盘/咕噜。我的Git和GitHub工作正常


有什么问题吗?

从github.com/gruntjs/grunt-contrib-compass下载的完整gruntfile.js包含许多可能没有用处的代码。我的错误是认为这段代码与安装过程有关,就像正常的软件安装一样

让noobie感到困惑的是,在终端/命令行中设置grunt的过程没有设置下载的gruntfile中的tasks和tasks文件夹。我可能还没有完全了解这一点,但在初始设置和Github上的文件之间似乎没有直接的联系。Github上的代码只是示例,需要删除或黑客攻击


谢谢@Kyle帮我解决这个问题

你能发布你的GrunFile和node.js版本吗?GrunFile中没有版本,我不知道如何获取node的版本,但它们都是在最近几天下载的。
node-v
将获取你的node.js版本号。你能发布你的GrunFile吗?Node.js是v0.10.26。我看不到发布整个grunt file.js的方法,但它是几天前从这里发布的。我开始怀疑问题出在gruntfile.js中。我试图理解这段代码的作用。到目前为止,我还没有看到创建/tasks文件夹或在其中放置什么的说明。module.exports=function(grunt){//Project configuration.grunt.initConfig({pkg:{name:{grunt contrib compass'},jshint:{all:['grunfile.js','tasks/*.js',''),options:{jshintrc:'.jshintrc'},