'require() of ES Module ... index.js from ...webpack.config.dev.js not supported

I am following this github repo: https://github.com/fernfalcnico/immersive-ar-app

According to the Author, we are supposed to install dependencies and then run the command
npm run dev,
but on running that, I am getting this error:

PS C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main> npm run dev
> [email protected] dev
> webpack serve --config webpack.config.dev.js

[webpack-cli] Failed to load 'C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\webpack.config.dev.js' config
[webpack-cli] Error [ERR_REQUIRE_ESM]: require() of ES Module C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\internal-ip\index.js from C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\webpack.config.dev.js not supported. Instead change the require of index.js in C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\webpack.config.dev.js to a dynamic import() which is available in all CommonJS modules. at require (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\v8-compile-cache\v8-compile-cache.js:159:20) at Object. (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\webpack.config.dev.js:3:12) at Module._compile (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\v8-compile-cache\v8-compile-cache.js:192:30) at async Promise.all (index 0) at async WebpackCLI.tryRequireThenImport (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\webpack-cli\lib\webpack-cli.js:57:26)
at async loadConfig (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\webpack-cli\lib\webpack-cli.js:1536:27) at async C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\webpack-cli\lib\webpack-cli.js:1589:36 at async Promise.all (index 0) at async WebpackCLI.resolveConfig (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\webpack-cli\lib\webpack-cli.js:1587:38) at async WebpackCLI.createCompiler (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\webpack-cli\lib\webpack-cli.js:2045:22)
at async Command. (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules@webpack-cli\serve\lib\index.js:103:30) at async Promise.all (index 1) at async Command. (C:\Users\vishi\Downloads\immersive-ar-app-main (1)\immersive-ar-app-main\node_modules\webpack-cli\lib\webpack-cli.js:1495:13) { code: 'ERR_REQUIRE_ESM' }

Image of error



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source