当我运行“npm run build”时,在 Webpack 的 cli.js 文件中遇到问题“TypeError: statsPresetToOptions is not a function”

问题描述 投票:0回答:1

我正在为 Phaser 3 项目使用 Web Pack,Web Pack 的版本如下,

"html-webpack-plugin": "^5.6.0",
"webpack": "^5.91.0", 
"webpack-cli": "^3.1.2", 
"webpack-dev-server": "^5.0.4"

当我运行 npm run build 时,在 Webpack 的 cli.js 文件中收到错误“TypeError: statsPresetToOptions is not a function” 参考下图 error image

尝试使用升级 webpack

 npm install webpack@latest

并且要解决所有问题,请使用

 npm audit fix -force   

但是问题并没有解决。

webpack
1个回答
-1
投票

这个错误有解决办法吗?

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.