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

由于 webpack-cliwebpack-dev-server 的版本不一致导致

# 期望

  "devDependencies": {
    "webpack": "^5.20.0",
    "webpack-cli": "^3.0.0",
    "webpack-dev-server": "^3.11.2"
  }

如果 webpack-cli 版本大于或等于 4.0 以上,需要卸载,然后安装版本 ^3.0.0

yarn remove webpack-cli
yarn add -D webpack-cli@^3.0.0