#使用webpack命令打包时,报错TypeError: Cannot read property ‘presetToOptions’ of undefined的解决办法
解决办法:根据错误提示信息,打开node_modules\webpack-cli\bin\cli.js,第137行,把const statsPresetToOptions = require(“webpack”).Stats.presetToOptions;中间Stats下标的这个.删掉。
保存后再次运行webpack就成功了!