naveen
naveen

Reputation: 41

parse error while running gulp

I get the following error in my command terminal whenever run gulp to minify JavaScript files.I checked all the files listed below but I don't seem to find any error.The error message is below: events.js:182 throw er; // Unhandled 'error' event ^ Error: Parse Error:

at new HTMLParser (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\html-minifier\src\htmlparser.js:236:13)    at minify (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\html-minifier\src\htmlminifier.js:861:3)
at Object.exports.minify (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\html-minifier\src\htmlminifier.js:1216:10)
at objectAssign.fileName (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\gulp-htmlmin\index.js:22:39)
at module.exports (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\tryit\tryit.js:8:9)
at minifyHtml (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\gulp-htmlmin\index.js:21:9)
at Transform.htmlminTransform [as _transform] (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\gulp-htmlmin\index.js:51:7)
at Transform._read (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\gulp-htmlmin\node_modules\readable-stream\lib\_stream_transform.js:182:10)
at Transform._write (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\gulp-htmlmin\node_modules\readable-stream\lib\_stream_transform.js:170:83)
at doWrite (C:\wamp64\www\webportaluser\viewvendingAdmin\node_modules\gulp-htmlmin\node_modules\readable-stream\lib\_stream_writable.js:406:64)

Upvotes: 4

Views: 1003

Answers (1)

Akbar Taghipour
Akbar Taghipour

Reputation: 334

You can use the following format to find the line that causes the error.

gulp.task('scripts', ['clean'], function () {
  return gulp.src('js/*.js')
    .pipe(uglify().on('error', function(e){
        console.log(e);
     }))
    .pipe(gulp.dest('minjs'));
});

Upvotes: 1

Related Questions