gulp-image-optimization build gives error -
my node , npm vesrions below
node v6.9.1 npm v3.10.9
my code
'use strict'; const gulp = require('gulp'); const imageop = require('gulp-image-optimization'); let dir = { srcimages: 'public/wps/source/images', build: 'public/wps/build/' }; const config = { src: dir.srcimages + '/**/*', dest: dir.build + 'images/' }; gulp.task('img-prod', function (cb) { gulp.src(config.src).pipe(imageop({ optimizationlevel: 5, progressive: true, interlaced: true })).pipe(gulp.dest(config.dest)).on('end', cb).on('error', cb); });
when gulp build throws error
internal/child_process.js:289 var err = this._handle.spawn(options); ^
typeerror: bad argument @ typeerror (native) @ childprocess.spawn (internal/child_process.js:289:26) @ exports.spawn (child_process.js:380:9) @ imagemin._optimizejpeg (/users/sureshraju/xxx/wps/web-pres/node_modules/image-min/imagemin.js:126:12) @ imagemin.optimize (/users/sureshraju/xxxx/wps/web-pres/node_modules/image-min/imagemin.js:57:26) @ module.exports (/users/sureshraju/xxxx/wps/web-pres/node_modules/image-min/imagemin.js:179:21) @ /users/sureshraju/xxxx/wps/web-pres/node_modules/gulp-image-optimization/index.js:38:17 @ fsreqwrap.oncomplete (fs.js:123:15)
do have svg files in source directory? have been getting exact same problem in project have picked else.
i omitted svg files glob , task ran without errors.
Comments
Post a Comment