Assets build error [webpack-cli] Error: Unknown option '--hide-modules'

Viewed 13738

I am using orocommerce 4.2.1 from AWS marketplace. I made some changes in scss and want to build the assets. When i run the command php74 bin/console oro:assets:build --env=prod

I get the following:

[centos@ip-172-31-28-85 commerce]$ php74 bin/console oro:assets:build --env=prod Building assets. '/usr/bin/node' './node_modules/webpack/bin/webpack.js' '--hide-modules' '--mode=production' '--env.stats=' '--env.symfony=prod' '--colors' [webpack-cli] Error: Unknown option '--hide-modules' [webpack-cli] Run 'webpack --help' to see available commands and options

In OroAssetsBuildCommand.php line 247:

How can I remove this --hide-modules. I tried removing from package.json but nothing works?

2 Answers

It seems you have upgraded the "webpack-cli" NPM package to 4, but the OroCommerce 4.2 LTS is compatible only with "^3.3.12". To fix an error, you have to downgrade the package back to 3.3.12 version.

Related