NPM run dev error: cannot find module ‘webpack cli / bin / config yargs‘

1- Open your package.json file

"devDependencies": {
    "webpack": "^5.2.0",
    "webpack-cli": "^4.1.0",
    "webpack-dev-server": "^3.11.0"
}

Webpack-cli: “^4.1.0”, which is version 4.*
2- Uninstall the current webpack-cli directive: NPM uninstall webpack-cli
3.* version directive: NPM install webpack-cli@3 -d

Just run NPM run dev!
 

Read More: