title: 'Module not found' error when running webpack
body: <p>A few days ago to solve a problem with the webpack module, I had to move my global dependencies to Development dependencies, before everything was working correctly, but now when I run the webpack it returns the following error:</p>
  <pre><code>ERROR in (webpack)/lib/node/NodeTargetPlugin.js 
  Module not found: Error: Can't resolve 'module' in '.../node_modules/webpack/lib/node'
   @ (webpack)/lib/node/NodeTargetPlugin.js 11:1-18
   @ ./node_modules/worker-loader/dist/index.js
   @ ./node_modules/worker-loader/dist/cjs.js
   @ ./node_modules/pdfjs-dist/webpack.js
   @ ./src/js/index.js
   @ multi ./src/js/index.js
  </code></pre>
  <p>I have already used the methods presented here on StackOverflow and other forums, such as
  delete the node_modules, yarn.lock folder, clear the cache and as mentioned above install the modules as development dependencies, but nothing worked.</p>
  <p>This is my package.json file</p>
  <pre><code>{
    &quot;name&quot;: &quot;AgileTag&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;Web app para automatizar a criação de etiquetas&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;webpack --mode development&quot;,
      &quot;build&quot;: &quot;webpack --mode production&quot;,
      &quot;start&quot;: &quot;webpack-dev-server --mode development --open&quot;
    },
    &quot;author&quot;: &quot;Luis Matheus&quot;,
    &quot;license&quot;: &quot;MIT&quot;,
    &quot;dependencies&quot;: {
      &quot;@babel/core&quot;: &quot;^7.10.5&quot;,
      &quot;@babel/polyfill&quot;: &quot;^7.10.4&quot;,
      &quot;@babel/preset-env&quot;: &quot;^7.10.4&quot;,
      &quot;@babel/runtime-corejs3&quot;: &quot;^7.10.5&quot;,
      &quot;@babel/types&quot;: &quot;^7.10.5&quot;,
      &quot;babel-core&quot;: &quot;^6.26.3&quot;,
      &quot;babel-loader&quot;: &quot;^8.1.0&quot;,
      &quot;core-js&quot;: &quot;^3.6.5&quot;,
      &quot;live-server&quot;: &quot;^1.2.1&quot;,
      &quot;pdfjs-dist&quot;: &quot;^2.4.456&quot;,
      &quot;regenerator-runtime&quot;: &quot;^0.13.5&quot;,
      &quot;yarn&quot;: &quot;^1.22.4&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;html-webpack-plugin&quot;: &quot;^4.3.0&quot;,
      &quot;webpack&quot;: &quot;^4.43.0&quot;,
      &quot;webpack-cli&quot;: &quot;^3.3.12&quot;,
      &quot;webpack-dev-server&quot;: &quot;^3.11.0&quot;,
      &quot;worker-loader&quot;: &quot;^2.0.0&quot;
    }
  }
  </code></pre>