A
A
Artyom2022-03-14 23:12:00
npm
Artyom, 2022-03-14 23:12:00

Module.createRequire is not a function how to fix?

When running npm start gives the following error when run on Debian

Failed to compile.

Module.createRequire is not a function
assets by path static/js/*.js 2.28 MiB
  asset static/js/bundle.js 2.27 MiB [emitted] (name: main) 1 related asset
  asset static/js/node_modules_web-vitals_dist_web-vitals_js.chunk.js 6.93 KiB [emitted] 1 related asset
asset index.html 1.05 KiB [emitted]
asset asset-manifest.json 458 bytes [emitted]
cached modules 3.02 MiB (javascript) 31.3 KiB (runtime) [cached] 144 modules

ERROR in Module.createRequire is not a function

ERROR in   Error: Child compilation failed:
  Module.createRequire is not a function

  - child-compiler.js:169 childCompiler.runAsChild
    [react-bio-test-site]/[html-webpack-plugin]/lib/child-compiler.js:169:18

  - Compiler.js:564 compile
    [react-bio-test-site]/[webpack]/lib/Compiler.js:564:11

  - Compiler.js:1183 hooks.afterCompile.callAsync.err
    [react-bio-test-site]/[webpack]/lib/Compiler.js:1183:17


  - Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
    [react-bio-test-site]/[tapable]/lib/Hook.js:18:14

  - Compiler.js:1179 compilation.seal.err
    [react-bio-test-site]/[webpack]/lib/Compiler.js:1179:33

  - Compilation.js:2785 finalCallback
    [react-bio-test-site]/[webpack]/lib/Compilation.js:2785:11

  - Compilation.js:3090 hooks.afterSeal.callAsync.err
    [react-bio-test-site]/[webpack]/lib/Compilation.js:3090:11


  - Hook.js:18 Hook.CALL_ASYNC_DELEGATE [as _callAsync]
    [react-bio-test-site]/[tapable]/lib/Hook.js:18:14



1 ERROR in child compilations (Use 'stats.children: true' resp. '--stats-children' for more details)
webpack 5.69.1 compiled with 3 errors in 1611 ms


How can I fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question