title: Cannot find module 'webpack-dev-middleware'
body: <p>I'm making a nodejs + expressjs server, and a react fat client (SPA). After I install this <code>package.json</code>:</p>
  
  <pre><code>{
    "name": "express-react",
    "version": "1.0.0",
    "description": "Some basic ReactJS",
    "author": "Greg",
    "license": "ISC",
    "private": true,
    "keywords": [
      "reactjs",
      "webpack"
    ],
    "scripts": {
      "start": "node ./bin/www"
    },
    "dependencies": {
      "body-parser": "~1.18.2",
      "cookie-parser": "~1.4.3",
      "debug": "~2.6.9",
      "express": "~4.15.5",
      "morgan": "~1.9.0",
      "pug": "^2.0.0-rc.4",
      "react": "^16.2.0",
      "react-dom": "^16.2.0",
      "react-redux": "^5.0.6",
      "redux": "^3.7.2",
      "redux-logger": "^3.0.6",
      "serve-favicon": "~2.4.5"
    },
    "devDependencies": {
      "babel-core": "^6.26.0",
      "babel-loader": "^7.1.2",
      "babel-plugin-react-html-attrs": "^2.1.0",
      "babel-plugin-transform-class-properties": "^6.24.1",
      "babel-plugin-transform-decorators-legacy": "^1.3.4",
      "babel-preset-es2015": "^6.24.1",
      "babel-preset-react": "^6.24.1",
      "babel-preset-stage-0": "^6.24.1",
      "webpack": "^3.10.0",
      "webpack-dev-middleware": "^2.0.5"
    }
  }
  </code></pre>
  
  <p>I got this error when I run <code>DEBUG=express-react:* &amp; npm start</code> command:</p>
  
  <pre><code>Error: Cannot find module 'webpack-dev-middleware'
  </code></pre>
  
  <p>My app.js was generated by the express-generator:</p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var favicon = require('serve-favicon');
  var logger = require('morgan');
  var cookieParser = require('cookie-parser');
  var bodyParser = require('body-parser');
  
  var config = require('./webpack.config.js');
  const webpackmiddleware = require('webpack-dev-middleware');
  var webpack = require('webpack');
  
  const compiler = webpack(config);
  
  var index = require('./routes/index');
  var users = require('./routes/users');
  
  var app = express();
  
  // view engine setup
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'pug');
  
  
  app.use(webpackmiddleware(compiler, {
    noInfo: true,
    publicPath: config.output.publicPath,
    stats: {colors: true},
  }));
  .....
  </code></pre>
  
  <p>It confuses me.. I defined the <code>webpack-dev-middleware</code> package in the package.json file, but it said its not found.. why?
  Have anybody met this problem before?</p>
  
  <p>Thanks for the responses / advices in advance!</p>