Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

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
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


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>



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


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(