S
S
SergeyKisliy2014-09-11 11:21:01
Automation
SergeyKisliy, 2014-09-11 11:21:01

Why does Gulp keep throwing an error?

Can you please tell me why I am getting an error in Gulp?
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');

// connect server 
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('default', ['connect', 'css', 'html', 'watch']);

Error in console
events.js:72
throw er; // Unhandled 'error' event
^
Error: EBUSY, open 'D:\WebServers\EasyPHP-DevServer-14.1VC9\data\localweb\projects\site4\css\main.css'
PS folder is located in local webserver projects out of habit, but the server itself is not running.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2014-09-11
@k12th

Error: EBUSY, open 'D:\WebServers\EasyPHP-DevServer-14.1VC9\data\localweb\projects\site4\css\main.css'

The file is busy, that is, some process has locked it and does not give it back.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question