Error: Cannot find module 'webpack-cli/bin/config-yargs'

If you upgrade webpack to 5. *, and webpack cli to 4. *, an error will be reported:

Error: Cannot find module 'webpack-cli/bin/config-yargs'

 

Temporary solution:
Back off webpack cli to version 3. * for example:

"webpack-cli": "^ 3.3.12"

原文地址:https://www.cnblogs.com/yaokunlun/p/13999834.html