Gulp 咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜;pPipe(…)不是一个函数;

Gulp 咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜;pPipe(…)不是一个函数;,gulp,gulp-imagemin,Gulp,Gulp Imagemin,运行gulp imagemin会导致以下错误: /.../node_modules/imagemin/index.js:64 const pipe = opts.plugins.length > 0 ? pPipe(opts.plugins)(input) : Promise.resolve(input); ^ TypeError: pPipe(...) is not a

运行
gulp imagemin
会导致以下错误:

/.../node_modules/imagemin/index.js:64
const pipe = opts.plugins.length > 0 ? pPipe(opts.plugins)(input) : Promise.resolve(input);
                                                          ^

TypeError: pPipe(...) is not a function
资料来源:

import plugins from 'gulp-load-plugins';
...
gulp.task('img:production', () =>
  gulp.src(`${config.dirs.src}/img/**/*`)
  .pipe(plugins().imagemin())
  .pipe(gulp.dest(`${config.dirs.dist}/img`))
);
...
gulp.task('build:production',
  [
   'img:production',
   'html:production',
   'css:production',
   'js:production',
   'copy',
   'critical',
  ],
);
  • 大口喝:
    3.9.1
  • 大口喝Imagemin:
    3.2.0

这似乎是当前版本的
gulp imagemin
的一个问题。但是它应该被升级版本修复,根据这个问题:

遇到了同样的问题。mchange mm hi..你能(只是为了测试)更改你的src吗。。带有“source/of/one/img.jpg?”字样。。没有字符串插值(ES6)和安全图像?@federicoscamuzzi感谢您的评论。但在Doug的评论之后,我已经提出了一个问题,并得到了一个答案,那就是这是一个已知的问题,应该通过升级版本来解决。