运行项目npm run dev时报错: ~Error: Cannot find module 'webpack-cli/bin/config-yargs', 原因是

webpack@3.X运行项目npm run dev时报错: ~Error: Cannot find module 'webpack-cli/bin/config-yargs'

我的原因是:  webpack-dev-server 版本问题,   "webpack": "^3.6.0", webpack-dev-server也是3.x的版本,  不兼容,  所以更改webpack-dev-server版本后即可~

😄我的版本如下: 

  "engines": {
    "node": ">= 8.0.0",
    "npm": ">= 5.0.0"
  },

 

"webpack": "^3.6.0",
"webpack-dev-server": "^2.9.1",

 

posted @ 2019-07-16 20:55  香甜薄荷  阅读(8960)  评论(0编辑  收藏  举报