nodejs-gulp图像处理错误-错误:生成[/] / optipng-bin / vendor / optipng ENOENT

时间:2019-06-25 08:20:25

标签: javascript node.js gulp

在Linux服务器中编译gulp 图像处理时遇到此错误。

但是当我在本地Windows服务器中尝试时,它运行正常!!

这是大口吃图片任务:

// image processing
gulp.task('images', function () {
    var out = folder.build + 'assets/img/';
    return gulp.src(folder.src + 'assets/img/**/*')
        .pipe(newer(out))
        .pipe(imagemin({
            optimizationLevel: 5,
            verbose: true
        }))
        .pipe(gulp.dest(out));
});

以下是错误日志:

[01:06:54] Using gulpfile ~/zubizi/gulpfile.js
[01:06:54] Starting 'images'...

events.js:167
      throw er; // Unhandled 'error' event
      ^
Error: spawn /home/zubizi/zubizi/node_modules/optipng-bin/vendor/optipng ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
    at onErrorNT (internal/child_process.js:421:16)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)
Emitted 'error' event at:
    at errorOrDestroy (internal/streams/destroy.js:98:12)
    at DestroyableTransform.onerror (_stream_readable.js:694:7)
    at DestroyableTransform.emit (events.js:182:13)
    at DestroyableTransform.EventEmitter.emit (domain.js:441:20)
    at Immediate.<anonymous> (/home/zubizi/zubizi/node_modules/through2-concurrent/through2-concurrent.js:37:14)
    at processImmediate (timers.js:634:17)
    at process.topLevelDomainCallback (domain.js:120:23)

0 个答案:

没有答案