When trying to install Grunt for the first time, and following many guides, I don't seem to be getting a Gruntfile.js in my project. Any ideas what I could be doing wrong?
macbookpro:Noemptytags $ sudo npm install grunt --save-dev
npm WARN package.json Noemptytags@0.0.0 No repository field.
npm WARN package.json Noemptytags@0.0.0 No README data
grunt@0.4.5 node_modules/grunt
├── dateformat@1.0.2-1.2.3
├── which@1.0.5
├── eventemitter2@0.4.14
├── getobject@0.1.0
├── rimraf@2.2.8
├── colors@0.6.2
├── async@0.1.22
├── hooker@0.2.3
├── grunt-legacy-util@0.2.0
├── exit@0.1.2
├── nopt@1.0.10 (abbrev@1.0.5)
├── lodash@0.9.2
├── minimatch@0.2.14 (sigmund@1.0.0, lru-cache@2.5.0)
├── glob@3.1.21 (inherits@1.0.0, graceful-fs@1.2.3)
├── coffee-script@1.3.3
├── underscore.string@2.2.1
├── iconv-lite@0.2.11
├── findup-sync@0.1.3 (glob@3.2.11, lodash@2.4.1)
├── js-yaml@2.0.5 (esprima@1.0.4, argparse@0.1.15)
└── grunt-legacy-log@0.1.1 (underscore.string@2.3.3, lodash@2.4.1)
It has created node_modules folder but no Gruntfile.js
Any insight would be greatly appreciated!
the grunt module is just a runner plugin for your tasks. you need to create your gruntfile manually.
there is 1 option if you want it to be generated:
install grunt-init globally:
$ npm install grunt-init -g
clone the grunt-init-gruntfile-repo
$ git clone https://github.com/gruntjs/grunt-init-gruntfile.git ~/.grunt-init/gruntfile
run grunt init in your directory
$ grunt-init gruntfile
voila
you could save yourself a lot of time, if you would use project-scaffolding-tools for your project. there are grunt-init-generators for jquery-plugins, gruntplugins. or even better, use yeoman. that generates your project-structure plus a useful gruntfile!