Home  >  Q&A  >  body text

javascript - When using gulp image to compress and copy files, the error events.js:160 is reported? Is my nodejs version wrong?

The executed js code is as follows

gulp.task('image',function () {
    gulp.src(app.srcPath + 'image/**/*')
        .pipe(gulp.dest(app.devPath + 'image'))
        .pipe($.imagemin())
        .pipe(gulp.dest(app.prdPath + 'image'));
});

The error report that appears is as shown

It said that enoent.js under cross-spawn was not found? ? ? I would like to ask, what plug-in does cnpm need to install for this?

PHPzPHPz2688 days ago621

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-05-16 13:38:10

    rm -rf node_modules/ && npm cache clean && npm i

    It reminds you that your image task has ended. Should it be a problem with the next task?

    reply
    0
  • 某草草

    某草草2017-05-16 13:38:10

    Is the path of your gulp.src correct? Is it app.srcPath+'/image' written like this

    reply
    0
  • Cancelreply