Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: stream.on is not a function #13

Closed
mradzinski opened this issue Jul 21, 2016 · 1 comment
Closed

TypeError: stream.on is not a function #13

mradzinski opened this issue Jul 21, 2016 · 1 comment

Comments

@mradzinski
Copy link

mradzinski commented Jul 21, 2016

This happens when I try to use to use jpegoptim on Linux.

TypeError: stream.on is not a function
    at Readable.wrap (/home/***/node_modules/readable-stream/lib/_stream_readable.js:753:10)
    at wrap (/home/***/node_modules/stream-combiner2/index.js:67:29)
    at combine (/home/***/node_modules/stream-combiner2/index.js:29:18)
    at Function.module.exports.obj (/home/***/node_modules/stream-combiner2/index.js:22:10)
    at Imagemin.createStream (/home/***/node_modules/imagemin/index.js:103:24)
    at Imagemin.run (/home/***/node_modules/imagemin/index.js:77:20)
    at DestroyableTransform.through.obj.percent (/home/***/node_modules/gulp-imagemin/index.js:56:12)
    at DestroyableTransform._transform (/home/***/node_modules/through2-concurrent/through2-concurrent.js:30:15)
    at DestroyableTransform.Transform._read (/home/***/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10)
    at DestroyableTransform.Transform._write (/home/***/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83)

Gulp task:

  var path = require('path');
  var gulpif = require('gulp-if');
  var pngquant = require('imagemin-pngquant');
  var jpegoptim = require('imagemin-jpegoptim');

  gulp.task('imagemin', function() {
    return gulp.src(path.join(dirs.source, dirs.images, '**/*.{jpg,jpeg,gif,svg,png}'))
      .pipe(plugins.changed(dest))
      .pipe(gulpif(args.production, plugins.imagemin({
        progressive: true,
        svgoPlugins: [{removeViewBox: false}],
        use: [
          pngquant({ speed: 10 }),
          jpegoptim({max:90})
        ]
      })))
      .pipe(gulp.dest(dest));
  });
@shinnn
Copy link
Contributor

shinnn commented Jul 21, 2016

@shinnn shinnn closed this as completed Jul 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants