grunt webpack Cannot find module 'webpack-dev-server'
<p>I have a grunt setup to bundle my react files using webpack and grunt-webpack. I am not using <code>webpack-dev-server</code> but still my grunt is outputting error as <code>Cannot find module 'webpack-dev-server'</code></p>

<p>Here is my grunt file:</p>

<pre><code>var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");

module.exports = function(grunt) {
  require('load-grunt-tasks')(grunt);
  grunt.loadNpmTasks("grunt-webpack");

  grunt.initConfig({
    eslint: {
      options: {
        configFile: 'eslint.json'
      },
      target: ['./react/components/**/*.js','./react/services/**/*.js', './node/source/**/*.js']
    },
    webpack: {
      options: webpackConfig,
      build:{}
    },
    watch: {
      app: {
        files: ['./react/main.js', './react/components/**/*.js','./react/services/**/*.js'],
        tasks: ["webpack"],
        options: {
          spawn: false,
        }
      }
    }
  });

  grunt.registerTask('lint', ['eslint']);
  grunt.registerTask('build', ['webpack']);
  grunt.registerTask('default', ['watch']);

};
</code></pre>

<p><code>webpack.config.js</code> file</p>

<pre><code>const path = require('path');
const buildDirectory = './node/static/js/';

module.exports = {
    entry: './react/main.js',
    resolve: {
        extensions: ['', '.js', '.jsx'],
    },
    output: {
        path: path.resolve(buildDirectory),
        filename: 'bundle.js',
    },
    externals: {
        'cheerio': 'window',
        'react/lib/ExecutionEnvironment': true,
        'react/lib/ReactContext': true,
    },
    stats: {
        assets: false,
        colors: false,
        modules: false,
        version: false,
        hash: false,
        timings: false,
        chunks: false,
        chunkModules: false
    },
    module: {
        loaders: [{
            test: /\.jsx?$/,
            exclude: /(node_modules|bower_components)/,
            loader: 'babel',
            query: {
                presets: ['react', 'es2015'],
            },
        }],
    },
    plugins: [],
};
</code></pre>

<p>Error output</p>

<pre><code>grunt build
Loading "webpack-dev-server.js" tasks...ERROR
&gt;&gt; Error: Cannot find module 'webpack-dev-server'
Loading "webpack-dev-server.js" tasks...ERROR
&gt;&gt; Error: Cannot find module 'webpack-dev-server'

Running "webpack:build" (webpack) task


Done.
</code></pre>

<p>This error gets resolved if I add <code>webpack-dev-server</code> package, but I don't want extra dependency in my project.</p>

<p>Packages:</p>

<pre><code>"webpack": "^1.13.1",
"grunt-webpack": "^1.0.14",
"grunt": "^1.0.1",
"grunt-contrib-watch": "^1.0.0",
"grunt-eslint": "^19.0.0",
</code></pre>