小编Big*_*pot的帖子

Gulp imagemin dest.on不是函数错误

我正在尝试使用imagemin缩小图像,但它会出错.无法理解我做错了什么.

这是我的gulpfile

'use strict';

var gulp = require('gulp');
var imagemin = require('imagemin');
var clean = require('gulp-clean');

gulp.task('img', function () {
  return gulp.src('src/img/**')
    .pipe(imagemin())
    .pipe(gulp.dest('build/img'));
});

gulp.task('clean', function() {
  console.log('-----------?????? build');
  return gulp.src('build', {read: false})
    .pipe(clean());
});
Run Code Online (Sandbox Code Playgroud)

并且来自控制台的错误消息

$ gulp img
(node:14312) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[22:10:20] Using gulpfile Z:\a\gulpfile.js
[22:10:20] Starting 'img'...
[22:10:20] 'img' errored after 26 ms
[22:10:20] TypeError: dest.on …
Run Code Online (Sandbox Code Playgroud)

javascript console node.js gulp imagemin

3
推荐指数
1
解决办法
2543
查看次数

标签 统计

console ×1

gulp ×1

imagemin ×1

javascript ×1

node.js ×1