S
S
SergeyKisliy2014-10-22 10:46:30
Automation
SergeyKisliy, 2014-10-22 10:46:30

Gulp.js keeps crashing after a few minutes of work. What is the problem ?

Hello!
I keep gulp.js crashing after a few minutes of work.. I thought it was because of the livereload that I had installed separately from gulp , and when it worked, when I concatenated with minification in gulp , the latter hung for a long time .. Removed livereload and started using it in gulp and now it crashes after some time. What could be the problem ?
gulpfile.js

var gulp = require('gulp'),
    concatCss = require('gulp-concat-css'),
    minifyCSS = require('gulp-minify-css'),
    prefix = require('gulp-autoprefixer'),
    livereload = require('gulp-livereload'),
    connect = require('gulp-connect'),
    minifyHTML = require('gulp-minify-html'),
    rename = require('gulp-rename'),
    uglify = require('gulp-uglify'),
    concat = require('gulp-concat');

gulp.task('connect', function() {
  connect.server({
    root: 'app',
    livereload: true
  });
});

// css
gulp.task('css', function () {
  gulp.src('css/*.css')
    .pipe(concatCss('bundle.css'))
    .pipe(prefix('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
    .pipe(minifyCSS())
    .pipe(rename('bundle.min.css'))
    .pipe(gulp.dest('app/css'))
    .pipe(connect.reload());
});

//html
gulp.task('html', function() {
  gulp.src('*.html')
    .pipe(minifyHTML())
    .pipe(gulp.dest('app'))
    .pipe(connect.reload());
});

//watch
gulp.task('watch' , function() {
  gulp.watch('css/*.css', ['css'])
  gulp.watch('*.html', ['html'])
})

gulp.task('scripts', function() {
return gulp.src('js/*.js')
.pipe(concat('main.js'))
.pipe(gulp.dest('app/js'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('app/js'));
});


gulp.task('default', ['connect', 'css', 'html', 'watch', 'scripts']);

PS D:\Dropbox\Работа\2014\Текущие\workspace\site_1_0_0> gulp
[11:28:54] Using gulpfile D:\Dropbox\Работа\2014\Текущие\workspace\site_1_0_0\gulpfile.js
[11:28:54] Starting 'connect'...
[11:28:54] Server started http://localhost:8080
[11:28:54] LiveReload started on port 35729
[11:28:54] Finished 'connect' after 352 ms
[11:28:54] Starting 'css'...
[11:28:54] Finished 'css' after 17 ms
[11:28:54] Starting 'html'...
[11:28:54] Finished 'html' after 11 ms
[11:28:54] Starting 'watch'...
[11:28:54] Finished 'watch' after 28 ms
[11:28:54] Starting 'scripts'...
[11:29:00] Finished 'scripts' after 5.56 s
[11:29:00] Starting 'default'...
[11:29:00] Finished 'default' after 12 ?s
[11:29:09] Starting 'html'...
[11:29:09] Finished 'html' after 6.04 ms
[11:29:57] Starting 'html'...
[11:29:57] Finished 'html' after 5.28 ms
[11:30:08] Starting 'html'...
[11:30:08] Finished 'html' after 3.11 ms
[11:30:50] Starting 'html'...
[11:30:50] Finished 'html' after 3.75 ms
[11:31:19] Starting 'html'...
[11:31:19] Finished 'html' after 1.87 ms
[11:31:28] Starting 'html'...
[11:31:28] Finished 'html' after 1.93 ms
[11:33:18] Starting 'html'...
[11:33:18] Finished 'html' after 2.12 ms

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: EBUSY, open 'D:\Dropbox\╨а╨░╨▒╨╛╤В╨░\2014\╨в╨╡╨║╤Г╤Й╨╕╨╡\workspace\site_1_0_0\index.html'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Delias, 2015-07-31
@SergeyKisliy

It turned out that Yandex is locking the disk, I have to turn off synchronization before layout :(
update - eventually left Yandex for Dropbox - everything is ok there.

_
_ _, 2014-10-22
@AMar4enko

Some sort of sharing error. So you won't understand.
You can install gulp-plumber and put .pipe(plumber()) before .pipe(minifyHTML())

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question