I had installed it globally by running npm install webpack -g and I had included it in my project by running npm install webpack --save-dev.
However, on running the
Common mistakes of this error is typo and most of the times it's writing module.export instead of module.exports. Also check the file name should be with a .js extension. e.g. webpack.config.js
module.export
module.exports
webpack.config.js