O
O
Oleg Komenda2018-06-21 12:33:25
Web development
Oleg Komenda, 2018-06-21 12:33:25

Gulp does not plow, what should I do?

Hello, gulpfile is not working, can you help me solve the problem?

var gulp = require("gulp"),
    browserSync = require('browser-sync');

gulp.task('server', function () {
   browserSync({
      port: 9000,
      server: {
          baseDir: 'app'
      }
   });
});

gulp.task('watch', function () {
   gulp.watch([
       'app/*.html',
       'app/js/**/*.js',
       'app/css/**/*.css'
   ]).on('change', browserSync.reload);
});

gulp.task('default', ['server', 'watch']);

Galp version
$ gulp-v
CLI version 3.9.1
Local version 4.0.0

And here is the description of the error:
[12:24:12] Using gulpfile ~\Desktop\sites\star\gulpfile.js
C:\Users\rafamont\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129
    gulpInst.start.apply(gulpInst, toRun);
                   ^

TypeError: Cannot read property 'apply' of undefined
    at C:\Users\rafamont\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:129:20
    at process._tickCallback (internal/process/next_tick.js:61:11)
    at Function.Module.runMain (internal/modules/cjs/loader.js:746:11)
    at startup (internal/bootstrap/node.js:238:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tyzberd, 2018-06-21
@tyzberd

https://github.com/gulpjs/gulp-cli/issues/84

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question