I set up a React project by using webpack, but after setup when I ran the code
webpack-dev-server --mode=development the app couldn’t work properly and throw the error:
Error: Cannot find module 'webpack-cli/bin/config-yargs' .
After googling for a while, I found out the reason was the versions of these libraries —
webpack-dev-server — I used couldn’t work together. So I reinstall them and used the older versions which are:
And now my setup works as well as expected.