gulp-imagemin可以安装,但使用的时候报错,如何解决?

问题遇到的现象和发生背景

gulp做音乐播放器的时候想要图片压缩,gulp-imagemin可以成功安装,但是不能使用

问题相关代码,请勿粘贴截图
运行结果及报错内容

Error [ERR_REQUIRE_ESM]: require() of ES Module E:\Desktop\Music Player\node_modules\gulp-imagemin\index.js from E:\Desktop\Music Player\gulpfile.js not supported.
Instead change the require of index.js in E:\Desktop\Music Player\gulpfile.js to a dynamic import() which is available in all CommonJS modules.
at Object. (E:\Desktop\Music Player\gulpfile.js:13:18)
at async Promise.all (index 0) {
code: 'ERR_REQUIRE_ESM'

我的解答思路和尝试过的方法
我想要达到的结果