K
K
Krab4eg2017-04-13 16:50:10
gulp.js
Krab4eg, 2017-04-13 16:50:10

GULP(browser-sync) stopped working. What is the problem?

GULP stopped working, I was making up a site, and suddenly gulp stopped working, I just can’t start it, I updated nodejs, it didn’t help
a25e29f5ce1e4ee68a3a61990ec5a4c8.png
_______________

var gulp           = require('gulp'),
    gutil          = require('gulp-util' ),
    sass           = require('gulp-sass'),
    browserSync    = require('browser-sync'),
    cleanCSS       = require('gulp-clean-css'),
    autoprefixer   = require('gulp-autoprefixer'),
    bourbon        = require('node-bourbon'),
    ftp            = require('vinyl-ftp');

gulp.task('browser-sync', function() {
  browserSync({
    proxy: "localhost",
    notify: false
  });
});
gulp.task('sass', function() {
  return gulp.src('catalog/view/theme/productshome/stylesheet/stylesheet.sass')
    .pipe(sass({
      includePaths: bourbon.includePaths
    }).on('error', sass.logError))
    .pipe(autoprefixer(['last 15 versions']))
    .pipe(cleanCSS())
    .pipe(gulp.dest('catalog/view/theme/productshome/stylesheet/'))
    .pipe(browserSync.reload({stream: true}))
});
gulp.task('watch', ['sass', 'browser-sync'], function() {
  gulp.watch('catalog/view/theme/productshome/stylesheet/stylesheet.sass', ['sass']);
  gulp.watch('catalog/view/theme/productshome/template/**/*.tpl', browserSync.reload);
  gulp.watch('catalog/view/theme/productshome/js/**/*.js', browserSync.reload);
  gulp.watch('catalog/view/theme/productshome/libs/**/*', browserSync.reload);
});
gulp.task('deploy', function() {
  var conn = ftp.create({
    host:      'hostname.com',
    user:      'username',
    password:  'userpassword',
    parallel:  10,
    log: gutil.log
  });
  var globs = [
  'catalog/view/theme/productshome/**'
  ];
  return gulp.src(globs, {buffer: false})
  .pipe(conn.dest('/path/to/folder/on/server'));
});
gulp.task('default', ['watch']);

"browser-sync": "^2.18.8",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "^3.1.1",
    "gulp-clean-css": "^2.0.12",
    "gulp-sass": "^2.3.2",
    "gulp-util": "^3.0.7",
    "node-bourbon": "^4.2.8",
    "vinyl-ftp": "^0.5.0"

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