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

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

运行npm run dev: webpack-dev-server --inline,出现报错的话,应该是webpack-dev-server的版本不兼容,最好降版本: npm install webpack-cli@3 --save-dev

"devDependencies": {
    "clean-webpack-plugin": "^3.0.0",
    "html-webpack-plugin": "^5.2.0",
    "webpack": "^5.24.2",
    "webpack-cli": "^3.3.12",
    "webpack-dev-server": "^3.11.2"
 }

 

posted @ 2021-02-27 14:03  浪里小韭菜  阅读(369)  评论(0编辑  收藏  举报