Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

i hard to build metronic rtl version demo1


Every trying all steps i get error in "npm run build --rtl --demo1"
Failed to load 'E:\metronic_html_v8.2.2_demo1\tools\webpack.config.js' config
[webpack-cli] ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and 'E:\metronic_html_v8.2.2_demo1\tools\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///E:/metronic_html_v8.2.2_demo1/tools/webpack.config.js:1:17
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:438:15)
at async WebpackCLI.tryRequireThenImport (E:\metronic_html_v8.2.2_demo1\tools\node_modules\webpack-cli\lib\webpack-cli.js:232:34)
at async loadConfigByPath (E:\metronic_html_v8.2.2_demo1\tools\node_modules\webpack-cli\lib\webpack-cli.js:1406:27)
at async WebpackCLI.loadConfig (E:\metronic_html_v8.2.2_demo1\tools\node_modules\webpack-cli\lib\webpack-cli.js:1515:38)
at async WebpackCLI.createCompiler (E:\metronic_html_v8.2.2_demo1\tools\node_modules\webpack-cli\lib\webpack-cli.js:1781:22)
at async WebpackCLI.runWebpack (E:\metronic_html_v8.2.2_demo1\tools\node_modules\webpack-cli\lib\webpack-cli.js:1877:20)


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


The error message stating that you are using Node.js v16.20.2. Please consider upgrading it to v18 or v20.

Also, please try using cmd command console instead of power shell.

Thanks



Hi,

Open your package.json file.

Look for the "type" property. It might look something like this:

{
"type": "module",
// ... other package.json configurations
}


Remove this and retry with the build command.

Thanks


Hi Faizal, I removed this "type": "module" and retried with the build command. npm run build --rtl --demo1

PS E:\metronic_html_v8.2.2_demo1\tools> npm run build --rtl --demo1
npm WARN cli npm v10.2.5 does not support Node.js v16.20.2. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.

> keenthemes@8.2.2 build
> webpack

[webpack-cli] Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
 - configuration[0].entry['js/widgets.bundle'] should be a non-empty array.
   -> All modules are loaded upon startup. The last one is exported.
PS E:\metronic_html_v8.2.2_demo1\tools> 
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(