webpack打包报错 Cannot find module 'webpack-cli/bin/config-yargs'

  • 查看package.json文件
// package.json

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

在 github 上找到问题:

https://github.com/webpack/webpack-cli/issues
webpack打包报错 Cannot find module 'webpack-cli/bin/config-yargs'

解决方案:

  1. 卸载 webpack-cli:npm uninstall webpack-cli
  2. 安装 webpack-cli 3.* 版本: npm install webpack-cli@3 -D

webpack打包报错 Cannot find module 'webpack-cli/bin/config-yargs'

上一篇:git错误: error: failed to push some refs to 'https://github.com/...


下一篇:Hive metastore三种配置方式