Answer the question
In order to leave comments, you need to log in
How to run gulp with livereload and opn?
The problem is this, I install npm install --save-dev gulp gulp-connect opn I write in gulpfile.js but after calling gulp it displays gulp: command not found
(I did everything according to the video on loftschool) here is the project itself https://github.com/ kovaldn/dz-port
is my gulpfile.js
var gulp = require("gulp"),
connect = require("gulp-connect"),
opn = require("opn");
gulp.task('connect', function() {
connect.server({
root: 'app',
livereload: true,
port: 8888
});
opn('http://localhost:8888');
});
gulp.task('html', function () {
gulp.src('./app/*.html')
.pipe(connect.reload());
});
gulp.task('css', function () {
gulp.src('./app/css/*.css')
.pipe(connect.reload());
});
gulp.task('js', function () {
gulp.src('./app/js/*.js')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./app/*.html'], ['html']);
gulp.watch(['./app/css/*.css'], ['css']);
gulp.watch(['./app/js/*.js'], ['js']);
});
gulp.task('default', ['connect', 'watch']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question