title: Grunt fails trying to load an empty module
body: <p>I'm a bit stuck with my Jenkins setup on OSX Lion 10.7.3.</p>
  
  <p>I'm using Grunt in my webapp to run Jasmine tests, build less, create cache manifest etc. Everything works on my laptop Lion 10.7.5, but on the server box grunt fails from time to time with the following error:</p>
  
  <pre><code>$ grunt less
  
  module.js:340
      throw err;
            ^
  Error: Cannot find module ''
      at Function.Module._resolveFilename (module.js:338:15)
      at Function.Module._load (module.js:280:25)
      at Module.require (module.js:362:17)
      at require (module.js:378:17)
      at ChildProcess.&lt;anonymous&gt; (/usr/local/lib/node_modules/grunt-cli/bin/grunt:44:3)
      at ChildProcess.EventEmitter.emit (events.js:99:17)
      at Process._handle.onexit (child_process.js:678:10)
  </code></pre>
  
  <p>This is intermittent, it fails approximately once out of five runs and is not task specific. It fails with the same rate when running grunt manifest or grunt test.</p>
  
  <p>Once thing I noticed is that when it works it takes a second or two until the task starts executing, but when it fails it fails immediately.</p>
  
  <p>I tried to remove node_modules, npm cache clear, reinstalling grunt-cli. Nothing works.</p>
  
  <p>Here's my package.json:</p>
  
  <pre><code>{
      "name": "webapp",
      "version": "0.0.0",
      "dependencies": {},
      "devDependencies": {
          "grunt": "0.4.0rc7",
          "grunt-contrib-copy": "0.4.0rc7",
          "grunt-contrib-concat": "0.1.2rc6",
          "grunt-contrib-coffee": "0.4.0rc7",
          "grunt-contrib-uglify": "0.1.1rc6",
          "grunt-contrib-compass": "0.1.1rc8",
          "grunt-contrib-jshint": "0.1.1rc6",
          "grunt-contrib-mincss": "0.4.0rc7",
          "grunt-contrib-connect": "0.1.1rc6",
          "grunt-contrib-clean": "0.4.0rc6",
          "grunt-contrib-htmlmin": "0.1.1rc7",
          "grunt-contrib-imagemin": "0.1.1rc8",
          "grunt-contrib-livereload": "0.1.0rc8",
          "grunt-contrib-jasmine": "~0.3.2",
          "grunt-contrib-less": "0.5.0",
          "grunt-manifest": "0.4.0",
          "grunt-jslint": "0.2.5",
          "grunt-bower-hooks": "~0.2.0",
          "grunt-usemin": "~0.1.7",
          "grunt-regarde": "~0.1.1",
          "grunt-requirejs": "~0.3.1",
          "grunt-mocha": "~0.2.2",
          "grunt-open": "~0.1.0",
          "matchdep": "~0.1.1"
      },
      "engines": {
          "node": "&gt;=0.8.0"
      }
  }
  </code></pre>
  
  <p>npm and node versions:</p>
  
  <pre><code>$ npm -version
  1.2.11
  $ node --version
  v0.8.20
  </code></pre>
  
  <p>I have now stripped down both packages.json and Gruntile.js:</p>
  
  <pre><code>$ cat package.json 
  {
      "name": "webapp",
      "version": "0.0.0",
      "dependencies": {},
      "devDependencies": {
          "grunt": "0.4.0rc7",
          "grunt-manifest": "0.4.0",
          "matchdep": "~0.1.1"
      },
      "engines": {
          "node": "&gt;=0.8.0"
      }
  }
  $ cat Gruntfile.js 
  'use strict';
  
  module.exports = function (grunt) {
      // load all grunt tasks
      require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
  
      grunt.initConfig({
          manifest: {
              generate: {
                  options: {
                      basePath: 'app/',
                      exclude: ['js/lib/amp/com.vaultus.api.WebApiAggregated.cache.js', 'js/lib/amp/com.vaultus.api.DebugWebApiAggregated.cache.js'],
                      timestamp: true
                  },
                  src: [
                      'index-hybrid.html',
                      '*.xml',
                      'js/**/*.js',
                      'css/**/*.css',
                      'css/images/**/*',
                      'i18n/**/*.js',
                      'template/**/*.html'
                  ],
                  dest: 'app/cache-manifest.mf'
              }
          }
      });
  
      grunt.registerTask('build', [
          'manifest'
      ]);
  
      grunt.registerTask('default', ['build']);
  };
  </code></pre>
  
  <p>No luck :(</p>