Got ENOENT error with gulp-image
Asked Answered
B

1

7

It seems there's an error with image optimizer libraries.

The same error happens on gulp-image-min and some other gulp plugins.

Anyone can help?

My gulp task:

var image = require('gulp-image');

gulp.task('images', function () {
    return gulp.src('app/images/*')
        .pipe(image())
        .pipe(gulp.dest('dist/images'));
});

And the result:

[13:22:35] Using gulpfile ~/Desktop/Test/gulpfile.js
[13:22:35] Starting 'images'...
{ Error: spawn /Users/Sam/Desktop/Test/node_modules/jpegoptim-bin/vendor/jpegoptim ENOENT
    at exports._errnoException (util.js:953:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
    at onErrorNT (internal/child_process.js:348:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn /Users/Sam/Desktop/Test/node_modules/jpegoptim-bin/vendor/jpegoptim',
path: '/Users/Sam/Desktop/Test/node_modules/jpegoptim-bin/vendor/jpegoptim',
spawnargs: 
[ '--strip-all',
    '--strip-iptc',
    '--strip-icc',
    '--stdin',
    '--stdout' ],
cmd: '/Users/Sam/Desktop/Test/node_modules/jpegoptim-bin/vendor/jpegoptim --strip-all --strip-iptc --strip-icc --stdin --stdout',
stdout: <Buffer >,
stderr: <Buffer > }
Bessiebessy answered 21/7, 2016 at 9:3 Comment(0)
T
1

according to this github issue comment try

  1. removing node_modules folder
  2. running npm install

Did fix the issue for me.

Tortilla answered 26/1, 2021 at 13:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.