M
M
Maxim Supreme2016-12-22 16:51:16
gulp.js
Maxim Supreme, 2016-12-22 16:51:16

BrowserSync won't start?

Something went wrong, I can’t understand what, the situation is as follows:
1) running gulp in sublime and everything seems to be fine, but browserSync does not start, and there are no errors.
Running 'default'...
[16:44:36] Using gulpfile D:\Site\vikpour\ready_html\gulpfile.js
[16:44:36] Starting 'styles'...
[16:44:36] Starting 'scripts'...
[16:44:36] Starting 'watch'...
[16:44:36] Finished 'watch' after 112 ms
[16:44:46] Finished 'scripts' after 10 s
and more he doesn't want to do anything...

var gulp         = require('gulp'),
    sass         = require('gulp-sass'),
    autoprefixer = require('gulp-autoprefixer'),
    cleanCSS     = require('gulp-clean-css'),
    rename       = require('gulp-rename'),
    browserSync  = require('browser-sync').create(),
    concat       = require('gulp-concat'),
    uglify       = require('gulp-uglify');

gulp.task('browser-sync', ['styles', 'scripts'], function() {
    browserSync.init({
        server: {
            baseDir: "./app"
        },
        notify: false
    });
});

gulp.task('styles', function () {
  return gulp.src('sass/*.sass')
  .pipe(sass({
    includePaths: require('node-bourbon').includePaths
  }).on('error', sass.logError))
  .pipe(rename({suffix: '.min', prefix : ''}))
  .pipe(autoprefixer({browsers: ['last 15 versions'], cascade: false}))
  .pipe(cleanCSS())
  .pipe(gulp.dest('app/css'))
  .pipe(browserSync.stream());
});

gulp.task('scripts', function() {
  return gulp.src([
    './app/libs/modernizr/modernizr.js',
    './app/libs/jquery/jquery-1.11.2.min.js',
    './app/libs/waypoints/waypoints.min.js',
    './app/libs/animate/animate-css.js',
    './app/libs/Magnific-Popup/jquery.magnific-popup.min.js',
    './app/libs/animateNumber/jquery.animateNumber.min.js',
    './app/libs/equalHeights/equalHeights.min.js',
    './app/libs/owl-carousel/owl.carousel.min.js',
    './app/libs/selectize/dist/js/standalone/selectize.min.js',
    ])
    .pipe(concat('libs.js'))
    .pipe(uglify()) //Minify libs.js
    .pipe(gulp.dest('./app/js/'));
});

gulp.task('watch', function () {
  gulp.watch('sass/*.sass', ['styles']);
  gulp.watch('app/libs/**/*.js', ['scripts']);
  gulp.watch('app/js/*.js').on("change", browserSync.reload);
  gulp.watch('app/*.html').on('change', browserSync.reload);
});

gulp.task('default', ['browser-sync', 'watch']);

I try to run another project, the following is written in the console:
Running 'default'...
module.js:472
throw err;
^
Error: Cannot find module 'internal/fs'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js: 498:17)
at require(internal/module.js:20:19)
at evalmachine.:17:20
at Object. (D:\web\vtpm\backup\ttp\node_modules\vinyl-fs\node_modules\graceful-fs\fs.js:11:1)
at Module._compile (module.js:571:32)
at Object.Module. _extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Kit, 2016-12-22
@ShadowOfCasper

config for studio

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question