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
This error will also occur if you are running the command 'webpack -w' against a directory that does not have a webpack config file.
So if you are opening a new terminal window or tab and haven't changed directory to the root of your project before running the webpack command you will receive the error.