V
V
Vladmoshkov2019-11-03 00:03:20
linux
Vladmoshkov, 2019-11-03 00:03:20

Can't run Gulp, gives SyntaxError: Unexpected end of input?

After entering the water, gulp will give out what is below, I tried to reinstall everything, it did not help. In general, 3 hours trying to solve the problem, nothing helps.
Hope you!

$ gulp
/mnt/c/Users/vladich/Desktop/www/technolife/gulpfile.js:90



SyntaxError: Unexpected end of input
    at Module._compile (internal/modules/cjs/loader.js:892:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at execute (/usr/lib/node_modules/gulp/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js:36:18)
    at Liftoff.handleArguments (/usr/lib/node_modules/gulp/node_modules/gulp-cli/index.js:201:24)
    at Liftoff.execute (/usr/lib/node_modules/gulp/node_modules/liftoff/index.js:201:12)
    at module.exports (/usr/lib/node_modules/gulp/node_modules/flagged-respawn/index.js:51:3)

==========================================================================================
var syntax        = 'sass', // Syntax: sass or scss;
    gulpversion   = '4'; // Gulp version: 3 or 4 (см. readme.txt)

var gulp          = require('gulp'),
    gutil         = require('gulp-util' ),
    sass          = require('gulp-sass'),
    browserSync   = require('browser-sync'),
    concat        = require('gulp-concat'),
    uglify        = require('gulp-uglify'),
    cleancss      = require('gulp-clean-css'),
    rename        = require('gulp-rename'),
    autoprefixer  = require('gulp-autoprefixer'),
    notify        = require("gulp-notify"),
    rsync         = require('gulp-rsync');

gulp.task('browser-sync', function() {
  browserSync({
    server: {
      baseDir: '_site'
    },
    notify: false,
    // open: false,
    // tunnel: true,
    // tunnel: "projectname", //Demonstration page: http://projectname.localtunnel.me
  })
});

gulp.task('styles', function() {
  return gulp.src(syntax+'/**/*.'+syntax+'')
  .pipe(sass({ outputStyle: 'expand' }).on("error", notify.onError()))
  .pipe(rename({ suffix: '.min', prefix : '' }))
  .pipe(autoprefixer(['last 15 versions']))
  .pipe(cleancss( {level: { 1: { specialComments: 0 } } })) // Opt., comment out when debugging
  .pipe(gulp.dest('css'))
  .pipe(gulp.dest('_site/css'))
  .pipe(browserSync.reload( {stream: true} ))
});

gulp.task('scripts', function() {
  return gulp.src([
    'libs/jquery/dist/jquery.min.js',
    'libs/likely/likely.js',
    'libs/prognroll/prognroll.js',
    'js/common.js', // Always at the end
    ])
  .pipe(concat('scripts.min.js'))
  .pipe(uglify()) // Mifify js (opt.)
  .pipe(gulp.dest('js'))
  .pipe(gulp.dest('_site/js'))
  .pipe(browserSync.reload({ stream: true }))
});

gulp.task('code', function() {
  return gulp.src(['*.html', '_site/**/*.html'])
  .pipe(browserSync.reload({ stream: true }))
});

gulp.task('rsync', function() {
  return gulp.src('site/**')
  .pipe(rsync({
    root: 'site/',
    hostname: '[email protected]',
    destination: 'techno/public_html/',
    include: ['*.htaccess'], // Includes files to deploy
    exclude: ['**/Thumbs.db', '**/*.DS_Store'], // Excludes files from deploy
    recursive: true,
    archive: true,
    silent: false,
    compress: true
  }))
});

if (gulpversion == 3) {
  gulp.task('watch', ['styles', 'scripts', 'browser-sync'], function() {
    gulp.watch(syntax+'/**/*.'+syntax+'', ['styles']);
    gulp.watch(['libs/**/*.js', 'js/common.js'], ['scripts']);
    gulp.watch(['*.html', '_site/**/*.html'], ['code'])
  });
  gulp.task('default', ['watch']);


if (gulpversion == 4) {
  gulp.task('watch', function() {
    gulp.watch(syntax+'/**/*.'+syntax+'', gulp.parallel('styles'));
    gulp.watch(['libs/**/*.js', 'js/common.js'], gulp.parallel('scripts'));
    gulp.watch(['*.html', '_site/**/*.html'], gulp.parallel('code'))
  });
  gulp.task('default', gulp.parallel('styles', 'scripts', 'browser-sync', 'watch'));
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question