title: How can I repair Webpack issue on React?
body: <p>Trying to install this React script:
  <a href="https://github.com/webdesignleader/referBeam" rel="nofollow noreferrer">https://github.com/webdesignleader/referBeam</a></p>
  <p>Followed the readme but think there might be version issues or something.</p>
  <p>Error Log:</p>
  <pre><code>$ webpack
  node:internal/modules/cjs/loader:936
    throw err;
    ^
  
  Error: Cannot find module 'resolve-cwd'
  Require stack:
  - /usr/share/nodejs/webpack/node_modules/import-local/index.js
  - /usr/share/nodejs/webpack/node_modules/webpack-cli/bin/cli.js
  - /usr/share/nodejs/webpack/bin/webpack.js
      at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
      at Function.Module._load (node:internal/modules/cjs/loader:778:27)
      at Module.require (node:internal/modules/cjs/loader:1005:19)
      at require (node:internal/modules/cjs/helpers:102:18)
      at Object.&lt;anonymous&gt; (/usr/share/nodejs/webpack/node_modules/import-local/index.js:3:20)
      at Module._compile (node:internal/modules/cjs/loader:1105:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
      '/usr/share/nodejs/webpack/node_modules/import-local/index.js',
      '/usr/share/nodejs/webpack/node_modules/webpack-cli/bin/cli.js',
      '/usr/share/nodejs/webpack/bin/webpack.js'
    ]
  }
  
  
  $ sudo webpack
  Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
   - configuration.module has an unknown property 'loaders'. These properties are valid:
     object { defaultRules?, exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, strictExportPresence?, strictThisContextOnImports?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
     -&gt; Options affecting the normal modules (`NormalModuleFactory`).
  </code></pre>