<h1 dir="auto">Bug report</h1>
<p dir="auto"><a href="https://github.com/crazyair/webpack-demo">https://github.com/crazyair/webpack-demo</a></p>




<p dir="auto"><strong>What is the current behavior?</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="➜  webpack-demo git:(master) ✗ yarn build
yarn run v1.22.5
warning package.json: No license field
$ webpack --progress --mode production --profile
assets by status 10.3 KiB [cached] 3 assets
runtime modules 5.29 KiB 7 modules
built modules 63 bytes [built]
  ./src/index.js 21 bytes [built] [code generated]
    48 ms (resolving: 35 ms, restoring: 0 ms, integration: 0 ms, building: 13 ms, storing: 0 ms, additional resolving: 16 ms)
  container entry 42 bytes [built] [code generated]
    3 ms (resolving: 0 ms, restoring: 0 ms, integration: 0 ms, building: 2 ms, storing: 1 ms)

ERROR in demo.js from Terser
Unexpected token: operator (-) [demo.js:1,11]
    at js_error (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:546:11)
    at croak (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1264:9)
    at token_error (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1272:9)
    at unexpected (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1278:9)
    at semicolon (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1309:56)
    at statement (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1497:17)
    at _embed_tokens_wrapper (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1322:26)
    at parse_toplevel (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:3439:23)
    at parse (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:3451:7)
    at minify (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:26237:38)

webpack 5.11.1 compiled with 1 error in 347 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command."><pre class="notranslate"><code class="notranslate">➜  webpack-demo git:(master) ✗ yarn build
yarn run v1.22.5
warning package.json: No license field
$ webpack --progress --mode production --profile
assets by status 10.3 KiB [cached] 3 assets
runtime modules 5.29 KiB 7 modules
built modules 63 bytes [built]
  ./src/index.js 21 bytes [built] [code generated]
    48 ms (resolving: 35 ms, restoring: 0 ms, integration: 0 ms, building: 13 ms, storing: 0 ms, additional resolving: 16 ms)
  container entry 42 bytes [built] [code generated]
    3 ms (resolving: 0 ms, restoring: 0 ms, integration: 0 ms, building: 2 ms, storing: 1 ms)

ERROR in demo.js from Terser
Unexpected token: operator (-) [demo.js:1,11]
    at js_error (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:546:11)
    at croak (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1264:9)
    at token_error (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1272:9)
    at unexpected (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1278:9)
    at semicolon (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1309:56)
    at statement (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1497:17)
    at _embed_tokens_wrapper (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:1322:26)
    at parse_toplevel (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:3439:23)
    at parse (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:3451:7)
    at minify (/Users/crazyair/Code/webpack-demo/node_modules/terser/dist/bundle.min.js:26237:38)

webpack 5.11.1 compiled with 1 error in 347 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
</code></pre></div>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce.</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="yarn
yarn build"><pre class="notranslate"><code class="notranslate">yarn
yarn build
</code></pre></div>






<p dir="auto"><strong>What is the expected behavior?</strong></p>


<p dir="auto"><strong>Other relevant information:</strong><br>
webpack version:  latest<br>
Node.js version: latest<br>
Operating System: mac<br>
Additional tools:</p>
<p dir="auto">Is webpack expected to work with 6.1.0? The "&gt;=0.6" in engines.node suggests so, but the output I get from <code class="notranslate">git clone</code>, <code class="notranslate">git checkout v1.13.0</code>, <code class="notranslate">npm install</code>, <code class="notranslate">npm test</code> is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="3887 passing (2m)
  19 pending
  6 failing

  1) ConfigTestCases extract-text issue-14 should compile:
     Error: Cannot find module 'webpack/lib/ConcatSource'
      at require (internal/module.js:20:19)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (test/configCases/extract-text/issue-14/webpack.config.js:1:73)
      at require (internal/module.js:20:19)
      at Context.&lt;anonymous&gt; (test/ConfigTestCases.test.js:29:20)

  2) Examples should compile code-splitted-css-bundle:
     Error: Cannot find module 'webpack/lib/ConcatSource'
      at require (internal/module.js:20:19)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (examples/code-splitted-css-bundle/webpack.config.js:1:87)
      at require (internal/module.js:20:19)
      at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)

  3) Examples should compile css-bundle:
     Error: Cannot find module 'webpack/lib/ConcatSource'
    at require (internal/module.js:20:19)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (examples/css-bundle/webpack.config.js:1:87)
    at require (internal/module.js:20:19)
    at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)


  4) Examples should compile i18n:
     Error: Cannot find module 'webpack/lib/dependencies/ConstDependency'
    at require (internal/module.js:20:19)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (examples/i18n/webpack.config.js:2:18)
    at require (internal/module.js:20:19)
    at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)


  5) Examples should compile multiple-entry-points-commons-chunk-css-bundle:
     Error: Cannot find module 'webpack/lib/ConcatSource'
    at require (internal/module.js:20:19)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (examples/multiple-entry-points-commons-chunk-css-bundle/webpack.config.js:3:25)
    at require (internal/module.js:20:19)
    at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)


  6) Examples should compile web-worker:
     Error: done() invoked with non-Error: Cannot find module 'webpack/lib/webworker/WebWorkerTemplatePlugin'
 @ (webpack)/examples/web-worker/example.js 1:13-39
    at test/Examples.test.js:42:13
    at Compiler.&lt;anonymous&gt; (lib/Compiler.js:194:14)
    at Compiler.emitRecords (lib/Compiler.js:282:37)
    at Compiler.&lt;anonymous&gt; (lib/Compiler.js:187:11)
    at lib/Compiler.js:275:11
    at Compiler.afterEmit (lib/Compiler.js:272:8)
    at Compiler.&lt;anonymous&gt; (lib/Compiler.js:267:14)
    at FSReqWrap.oncomplete (fs.js:117:15)"><pre class="notranslate"><code class="notranslate">3887 passing (2m)
  19 pending
  6 failing

  1) ConfigTestCases extract-text issue-14 should compile:
     Error: Cannot find module 'webpack/lib/ConcatSource'
      at require (internal/module.js:20:19)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (test/configCases/extract-text/issue-14/webpack.config.js:1:73)
      at require (internal/module.js:20:19)
      at Context.&lt;anonymous&gt; (test/ConfigTestCases.test.js:29:20)

  2) Examples should compile code-splitted-css-bundle:
     Error: Cannot find module 'webpack/lib/ConcatSource'
      at require (internal/module.js:20:19)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (examples/code-splitted-css-bundle/webpack.config.js:1:87)
      at require (internal/module.js:20:19)
      at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)

  3) Examples should compile css-bundle:
     Error: Cannot find module 'webpack/lib/ConcatSource'
    at require (internal/module.js:20:19)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (examples/css-bundle/webpack.config.js:1:87)
    at require (internal/module.js:20:19)
    at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)


  4) Examples should compile i18n:
     Error: Cannot find module 'webpack/lib/dependencies/ConstDependency'
    at require (internal/module.js:20:19)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (examples/i18n/webpack.config.js:2:18)
    at require (internal/module.js:20:19)
    at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)


  5) Examples should compile multiple-entry-points-commons-chunk-css-bundle:
     Error: Cannot find module 'webpack/lib/ConcatSource'
    at require (internal/module.js:20:19)
    at require (internal/module.js:20:19)
    at Object.&lt;anonymous&gt; (examples/multiple-entry-points-commons-chunk-css-bundle/webpack.config.js:3:25)
    at require (internal/module.js:20:19)
    at Context.&lt;anonymous&gt; (test/Examples.test.js:20:15)


  6) Examples should compile web-worker:
     Error: done() invoked with non-Error: Cannot find module 'webpack/lib/webworker/WebWorkerTemplatePlugin'
 @ (webpack)/examples/web-worker/example.js 1:13-39
    at test/Examples.test.js:42:13
    at Compiler.&lt;anonymous&gt; (lib/Compiler.js:194:14)
    at Compiler.emitRecords (lib/Compiler.js:282:37)
    at Compiler.&lt;anonymous&gt; (lib/Compiler.js:187:11)
    at lib/Compiler.js:275:11
    at Compiler.afterEmit (lib/Compiler.js:272:8)
    at Compiler.&lt;anonymous&gt; (lib/Compiler.js:267:14)
    at FSReqWrap.oncomplete (fs.js:117:15)
</code></pre></div>
<p dir="auto">All the errors are missing module error, so I wonder if there's an additional step required to run tests locally.</p>