title: Error in ./node_modules/react-router-dom Modules not found after npm update v5.4.2
body: <p>When I tried to update my npm version from 3.10.10 to 5.4.2 and migrate react from 15.3.0 to 16.0 I deleted node_modules and ran npm install again. After that I tried to run my application but got following error:</p>
  <pre><code>ERROR in ./node_modules/react-router-dom/es/BrowserRouter.js
  Module not found: Error: Can't resolve 'history/createBrowserHistory' in 'D:\app\node_modules\react-router-dom\es'
   @ ./node_modules/react-router-dom/es/BrowserRouter.js 10:0-57
   @ ./node_modules/react-router-dom/es/index.js
   @ ./src/index.js
   @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js
  ERROR in ./node_modules/react-router-dom/es/HashRouter.js
  Module not found: Error: Can't resolve 'history/createHashHistory' in 'D:\app\node_modules\react-router-dom\es'
   @ ./node_modules/react-router-dom/es/HashRouter.js 10:0-54
   @ ./node_modules/react-router-dom/es/index.js
   @ ./src/index.js
   @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js
  ERROR in ./node_modules/react-router-dom/es/MemoryRouter.js
  Module not found: Error: Can't resolve 'react-router/es/MemoryRouter' in 'D:\app\node_modules\react-router-dom\es'
   @ ./node_modules/react-router-dom/es/MemoryRouter.js 2:0-56
   @ ./node_modules/react-router-dom/es/index.js
   @ ./src/index.js
   @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js
  ERROR in ./node_modules/react-router-dom/es/Prompt.js
  Module not found: Error: Can't resolve 'react-router/es/Prompt' in 'D:\app\node_modules\react-router-dom\es'
   @ ./node_modules/react-router-dom/es/Prompt.js 2:0-44
   @ ./node_modules/react-router-dom/es/index.js
   @ ./src/index.js
   @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js
  ERROR in ./node_modules/react-router-dom/es/StaticRouter.js
  Module not found: Error: Can't resolve 'react-router/es/StaticRouter' in 'D:\app\node_modules\react-router-dom\es'
   @ ./node_modules/react-router-dom/es/StaticRouter.js 2:0-56
   @ ./node_modules/react-router-dom/es/index.js
   @ ./src/index.js
   @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js
  ERROR in ./node_modules/react-router-dom/es/Switch.js
  Module not found: Error: Can't resolve 'react-router/es/Switch' in 'D:\app\node_modules\react-router-dom\es'
   @ ./node_modules/react-router-dom/es/Switch.js 2:0-44
   @ ./node_modules/react-router-dom/es/index.js
   @ ./src/index.js
   @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js
  ERROR in ./node_modules/react-router-dom/es/matchPath.js
  Module not found: Error: Can't resolve 'react-router/es/matchPath' in 'D:\app\node_modules\react-router-dom\es'
   @ ./node_modules/react-router-dom/es/matchPath.js 2:0-50
   @ ./node_modules/react-router-dom/es/index.js
   @ ./src/index.js
   @ multi ./src/webpack-public-path react-hot-loader/patch webpack-hot-middleware/client?reload=true ./src/index.js
  </code></pre>
  <p>My package.json:</p>
  <pre><code>{
    &quot;name&quot;: &quot;MyApp&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;application&quot;,
    &quot;engines&quot;: {
      &quot;npm&quot;: &quot;&gt;=3&quot;
    },
    &quot;scripts&quot;: {
      &quot;preinstall&quot;: &quot;node tools/nodeVersionCheck.js&quot;,
      &quot;start-message&quot;: &quot;babel-node tools/startMessage.js&quot;,
      &quot;prestart&quot;: &quot;npm-run-all --parallel start-message&quot;,
      &quot;start&quot;: &quot;npm-run-all --parallel test:watch open:src lint:watch&quot;,
      &quot;open:src&quot;: &quot;babel-node tools/srcServer.js&quot;,
      &quot;open:dist&quot;: &quot;babel-node tools/distServer.js&quot;,
      &quot;lint&quot;: &quot;esw webpack.config.* src tools --color&quot;,
      &quot;lint:watch&quot;: &quot;npm run lint -- --watch&quot;,
      &quot;clean-dist&quot;: &quot;npm run remove-dist &amp;&amp; mkdir dist&quot;,
      &quot;remove-dist&quot;: &quot;rimraf ./dist&quot;,
      &quot;prebuild&quot;: &quot;npm run clean-dist &amp;&amp; npm run lint &amp;&amp; npm run test&quot;,
      &quot;build&quot;: &quot;babel-node tools/build.js &amp;&amp; npm run open:dist&quot;,
      &quot;test&quot;: &quot;jest&quot;,
      &quot;test:CI&quot;: &quot;babel-node tools/testCi.js&quot;,
      &quot;test:cover&quot;: &quot;npm run test -- --coverage &quot;,
      &quot;test:cover:CI&quot;: &quot;npm run test:CI -- --coverage &amp;&amp; cat ./coverage/lcov.info | node_modules/coveralls/bin/coveralls.js&quot;,
      &quot;test:watch&quot;: &quot;npm run test -- --watch&quot;,
      &quot;open:cover&quot;: &quot;npm run test:cover &amp;&amp; opn ./coverage/lcov-report/index.html&quot;,
      &quot;analyze-bundle&quot;: &quot;babel-node ./tools/analyzeBundle.js&quot;
    },
    &quot;author&quot;: &quot;me&quot;,
    &quot;license&quot;: &quot;me&quot;,
    &quot;dependencies&quot;: {
      &quot;@devexpress/dx-react-core&quot;: &quot;1.0.0-alpha.10&quot;,
      &quot;@devexpress/dx-react-grid&quot;: &quot;1.0.0-alpha.10&quot;,
      &quot;@devexpress/dx-react-grid-material-ui&quot;: &quot;1.0.0-alpha.10&quot;,
      &quot;material-ui&quot;: &quot;1.0.0-beta.11&quot;,
      &quot;material-ui-icons&quot;: &quot;1.0.0-beta.15&quot;,
      &quot;object-assign&quot;: &quot;4.1.1&quot;,
      &quot;react&quot;: &quot;16.0.0&quot;,
      &quot;react-autosuggest&quot;: &quot;9.3.2&quot;,
      &quot;react-dom&quot;: &quot;16.0.0&quot;,
      &quot;react-redux&quot;: &quot;5.0.6&quot;,
      &quot;react-router-dom&quot;: &quot;4.2.2&quot;,
      &quot;react-router-redux&quot;: &quot;4.0.8&quot;,
      &quot;redux&quot;: &quot;3.7.2&quot;,
      &quot;redux-thunk&quot;: &quot;2.2.0&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;autoprefixer&quot;: &quot;7.1.3&quot;,
      &quot;autosuggest-highlight&quot;: &quot;3.1.0&quot;,
      &quot;babel-cli&quot;: &quot;6.26.0&quot;,
      &quot;babel-core&quot;: &quot;6.26.0&quot;,
      &quot;babel-eslint&quot;: &quot;7.2.3&quot;,
      &quot;babel-jest&quot;: &quot;20.0.3&quot;,
      &quot;babel-loader&quot;: &quot;7.1.2&quot;,
      &quot;babel-plugin-transform-class-properties&quot;: &quot;6.24.1&quot;,
      &quot;babel-plugin-transform-react-constant-elements&quot;: &quot;6.23.0&quot;,
      &quot;babel-plugin-transform-react-remove-prop-types&quot;: &quot;0.4.8&quot;,
      &quot;babel-polyfill&quot;: &quot;6.26.0&quot;,
      &quot;babel-preset-env&quot;: &quot;1.6.0&quot;,
      &quot;babel-preset-react&quot;: &quot;6.24.1&quot;,
      &quot;babel-preset-react-hmre&quot;: &quot;1.1.1&quot;,
      &quot;babel-preset-stage-1&quot;: &quot;6.24.1&quot;,
      &quot;browser-sync&quot;: &quot;2.18.13&quot;,
      &quot;chalk&quot;: &quot;2.1.0&quot;,
      &quot;connect-history-api-fallback&quot;: &quot;1.3.0&quot;,
      &quot;coveralls&quot;: &quot;2.13.1&quot;,
      &quot;css-loader&quot;: &quot;0.28.7&quot;,
      &quot;enzyme&quot;: &quot;2.9.1&quot;,
      &quot;eslint&quot;: &quot;4.5.0&quot;,
      &quot;eslint-plugin-import&quot;: &quot;2.7.0&quot;,
      &quot;eslint-plugin-react&quot;: &quot;7.3.0&quot;,
      &quot;eslint-watch&quot;: &quot;3.1.2&quot;,
      &quot;extract-text-webpack-plugin&quot;: &quot;3.0.0&quot;,
      &quot;file-loader&quot;: &quot;0.11.2&quot;,
      &quot;html-webpack-plugin&quot;: &quot;2.30.1&quot;,
      &quot;identity-obj-proxy&quot;: &quot;3.0.0&quot;,
      &quot;jest&quot;: &quot;21.2.1&quot;,
      &quot;jest-cli&quot;: &quot;21.2.1&quot;,
      &quot;json-loader&quot;: &quot;0.5.7&quot;,
      &quot;lodash&quot;: &quot;4.17.4&quot;,
      &quot;mockdate&quot;: &quot;2.0.2&quot;,
      &quot;node-sass&quot;: &quot;4.5.3&quot;,
      &quot;npm-run-all&quot;: &quot;4.1.1&quot;,
      &quot;numeral&quot;: &quot;2.0.6&quot;,
      &quot;opn-cli&quot;: &quot;3.1.0&quot;,
      &quot;postcss-loader&quot;: &quot;2.0.6&quot;,
      &quot;prompt&quot;: &quot;1.0.0&quot;,
      &quot;prop-types&quot;: &quot;15.6.0&quot;,
      &quot;react-hot-loader&quot;: &quot;3.0.0-beta.6&quot;,
      &quot;react-test-renderer&quot;: &quot;16.0.0&quot;,
      &quot;react-validation&quot;: &quot;2.10.9&quot;,
      &quot;redux-immutable-state-invariant&quot;: &quot;2.0.0&quot;,
      &quot;replace&quot;: &quot;0.3.0&quot;,
      &quot;rimraf&quot;: &quot;2.6.1&quot;,
      &quot;sass-loader&quot;: &quot;6.0.6&quot;,
      &quot;style-loader&quot;: &quot;0.18.2&quot;,
      &quot;typeface-roboto&quot;: &quot;0.0.35&quot;,
      &quot;url-loader&quot;: &quot;0.5.9&quot;,
      &quot;validator&quot;: &quot;8.2.0&quot;,
      &quot;webpack&quot;: &quot;3.5.5&quot;,
      &quot;webpack-bundle-analyzer&quot;: &quot;2.9.0&quot;,
      &quot;webpack-dev-middleware&quot;: &quot;1.12.0&quot;,
      &quot;webpack-hot-middleware&quot;: &quot;2.18.2&quot;,
      &quot;webpack-md5-hash&quot;: &quot;0.0.5&quot;
    },
    &quot;keywords&quot;: [],
    &quot;repository&quot;: {
      &quot;type&quot;: &quot;git&quot;,
      &quot;url&quot;: &quot;&quot;
    },
    &quot;jest&quot;: {
      &quot;moduleNameMapper&quot;: {
        &quot;\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$&quot;: &quot;&lt;rootDir&gt;/tools/assetsTransformer.js&quot;,
        &quot;\\.(css|less)$&quot;: &quot;&lt;rootDir&gt;/tools/assetsTransformer.js&quot;
      }
    },
    &quot;babel&quot;: {
      &quot;presets&quot;: [
        &quot;react&quot;,
        &quot;stage-1&quot;
      ],
      &quot;env&quot;: {
        &quot;development&quot;: {
          &quot;presets&quot;: [
            &quot;env&quot;,
            &quot;react-hmre&quot;
          ],
          &quot;plugins&quot;: [
            &quot;transform-class-properties&quot;
          ]
        },
        &quot;production&quot;: {
          &quot;presets&quot;: [
            [
              &quot;env&quot;,
              {
                &quot;es2015&quot;: {
                  &quot;modules&quot;: false
                },
                &quot;targets&quot;: {
                  &quot;ie&quot;: 9,
                  &quot;uglify&quot;: true
                }
              }
            ]
          ],
          &quot;plugins&quot;: [
            &quot;transform-react-constant-elements&quot;,
            &quot;transform-react-remove-prop-types&quot;,
            &quot;transform-class-properties&quot;
          ]
        },
        &quot;test&quot;: {
          &quot;presets&quot;: [
            &quot;env&quot;
          ]
        }
      }
    },
    &quot;eslintConfig&quot;: {
      &quot;root&quot;: true,
      &quot;extends&quot;: [
        &quot;eslint:recommended&quot;,
        &quot;plugin:import/errors&quot;,
        &quot;plugin:import/warnings&quot;
      ],
      &quot;plugins&quot;: [
        &quot;react&quot;
      ],
      &quot;parser&quot;: &quot;babel-eslint&quot;,
      &quot;parserOptions&quot;: {
        &quot;ecmaVersion&quot;: 6,
        &quot;sourceType&quot;: &quot;module&quot;,
        &quot;ecmaFeatures&quot;: {
          &quot;jsx&quot;: true,
          &quot;experimentalObjectRestSpread&quot;: true
        }
      },
      &quot;env&quot;: {
        &quot;es6&quot;: true,
        &quot;browser&quot;: true,
        &quot;node&quot;: true,
        &quot;jquery&quot;: true,
        &quot;jest&quot;: true
      },
      &quot;rules&quot;: {
        &quot;quotes&quot;: 0,
        &quot;no-console&quot;: 1,
        &quot;no-debugger&quot;: 1,
        &quot;no-var&quot;: 1,
        &quot;semi&quot;: [
          1,
          &quot;always&quot;
        ],
        &quot;no-trailing-spaces&quot;: 0,
        &quot;eol-last&quot;: 0,
        &quot;no-underscore-dangle&quot;: 0,
        &quot;no-alert&quot;: 0,
        &quot;no-lone-blocks&quot;: 0,
        &quot;jsx-quotes&quot;: 1,
        &quot;react/display-name&quot;: [
          1,
          {
            &quot;ignoreTranspilerName&quot;: false
          }
        ],
        &quot;react/forbid-prop-types&quot;: [
          1,
          {
            &quot;forbid&quot;: [
              &quot;any&quot;
            ]
          }
        ],
        &quot;react/jsx-boolean-value&quot;: 0,
        &quot;react/jsx-closing-bracket-location&quot;: 0,
        &quot;react/jsx-curly-spacing&quot;: 1,
        &quot;react/jsx-indent-props&quot;: 0,
        &quot;react/jsx-key&quot;: 1,
        &quot;react/jsx-max-props-per-line&quot;: 0,
        &quot;react/jsx-no-bind&quot;: 0,
        &quot;react/jsx-no-duplicate-props&quot;: 1,
        &quot;react/jsx-no-literals&quot;: 0,
        &quot;react/jsx-no-undef&quot;: 1,
        &quot;react/jsx-pascal-case&quot;: 1,
        &quot;react/jsx-sort-prop-types&quot;: 0,
        &quot;react/jsx-sort-props&quot;: 0,
        &quot;react/jsx-uses-react&quot;: 1,
        &quot;react/jsx-uses-vars&quot;: 1,
        &quot;react/jsx-wrap-multilines&quot;: 1,
        &quot;react/no-danger&quot;: 1,
        &quot;react/no-did-mount-set-state&quot;: 1,
        &quot;react/no-did-update-set-state&quot;: 1,
        &quot;react/no-direct-mutation-state&quot;: 1,
        &quot;react/no-multi-comp&quot;: 1,
        &quot;react/no-set-state&quot;: 0,
        &quot;react/no-unknown-property&quot;: 1,
        &quot;react/prefer-es6-class&quot;: 1,
        &quot;react/prop-types&quot;: 1,
        &quot;react/react-in-jsx-scope&quot;: 1,
        &quot;import/extensions&quot;: 1,
        &quot;react/self-closing-comp&quot;: 1,
        &quot;react/sort-comp&quot;: 1
      },
      &quot;globals&quot;: {}
    }
  }
  </code></pre>
  <p>If I use npm version 3.10.10 and react 15.3.0 I can run my application normally but if I want to for example update react or material-ui I get UNMET PEER DEPENDENCE Error for some reason. NOTE: node version 6.11.4.</p>