Answer the question
In order to leave comments, you need to log in
What is the problem? gulp error?
When you run the command
In the terminal such a hat
$ gulp
[01:09:44] Using gulpfile ~/Sites/testing1/gulpfile.js
[01:09:44] Starting 'html:build'...
[01:09:44] Finished 'html:build' after 8.22 ms
[01:09:44] Starting 'js:build'...
[01:09:44] Finished 'js:build' after 6.63 ms
[01:09:44] Starting 'style:build'...
[01:09:44] Finished 'style:build' after 12 ms
[01:09:44] Starting 'fonts:build'...
[01:09:44] Finished 'fonts:build' after 1.08 ms
[01:09:44] Starting 'image:build'...
[01:09:44] Finished 'image:build' after 3.85 ms
[01:09:44] Starting 'build'...
[01:09:44] Finished 'build' after 3.32 μs
[01:09:44] Starting 'webserver'...
[01:09:44] Finished 'webserver' after 128 ms
[01:09:44] Starting 'watch'...
[01:09:44] Finished 'watch' after 12 ms
[01:09:44] Starting 'default'...
[01:09:44] Finished 'default' after 4.71 μs
[01:09:44] gulp-imagemin: Minified 0 images
buffer.js:67
throw new TypeError('must start with number, buffer, array or string');
^
TypeError: must start with number, buffer, array or string
at new Buffer (buffer.js:67:11)
at /Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/index.js:20:29
at Rigger.<anonymous> (/Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/node_modules/rigger/index.js:719:9)
at Rigger.emit (events.js:107:17)
at /Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/node_modules/rigger/index.js:252:16
at /Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/node_modules/rigger/node_modules/async/lib/async.js:232:13
at /Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/node_modules/rigger/node_modules/async/lib/async.js:113:21
at /Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/node_modules/rigger/node_modules/async/lib/async.js:24:16
at /Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/node_modules/rigger/node_modules/async/lib/async.js:229:17
at /Users/Aleksandr/Sites/testing1/node_modules/gulp-rigger/node_modules/rigger/index.js:391:21
'use strict';
var gulp = require('gulp'),
watch = require('gulp-watch'),
prefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
rigger = require('gulp-rigger'),
cssmin = require('gulp-minify-css'),
imagemin = require('gulp-imagemin'),
pngquant = require('imagemin-pngquant'),
rimraf = require('rimraf'),
browserSync = require("browser-sync"),
reload = browserSync.reload;
var path = {
build: {
html: 'build/',
js: 'build/js/',
css: 'build/css/',
img: 'build/img/',
fonts: 'build/fonts/'
},
src: {
html: 'src/*.html',
js: 'src/js/main.js',
style: 'src/style/main.scss',
img: 'src/img/**/*.*',
fonts: 'src/fonts/**/*.*'
},
watch: {
html: 'src/**/*.html',
js: 'src/js/**/*.js',
style: 'src/style/**/*.scss',
img: 'src/img/**/*.*',
fonts: 'src/fonts/**/*.*'
},
clean: './build'
};
var config = {
server: {
baseDir: "./build"
},
tunnel: true,
host: 'localhost',
port: 9000,
logPrefix: "Frontend_Devil"
};
gulp.task('webserver', function () {
browserSync(config);
});
gulp.task('clean', function (cb) {
rimraf(path.clean, cb);
});
gulp.task('html:build', function () {
gulp.src(path.src.html)
.pipe(rigger())
.pipe(gulp.dest(path.build.html))
.pipe(reload({stream: true}));
});
gulp.task('js:build', function () {
gulp.src(path.src.js)
.pipe(rigger())
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(sourcemaps.write())
.pipe(gulp.dest(path.build.js))
.pipe(reload({stream: true}));
});
gulp.task('style:build', function () {
gulp.src(path.src.style)
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: ['src/style/'],
outputStyle: 'compressed',
sourceMap: true,
errLogToConsole: true
}))
.pipe(prefixer())
.pipe(cssmin())
.pipe(sourcemaps.write())
.pipe(gulp.dest(path.build.css))
.pipe(reload({stream: true}));
});
gulp.task('image:build', function () {
gulp.src(path.src.img)
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}],
use: [pngquant()],
interlaced: true
}))
.pipe(gulp.dest(path.build.img))
.pipe(reload({stream: true}));
});
gulp.task('fonts:build', function() {
gulp.src(path.src.fonts)
.pipe(gulp.dest(path.build.fonts))
});
gulp.task('build', [
'html:build',
'js:build',
'style:build',
'fonts:build',
'image:build'
]);
gulp.task('watch', function(){
watch([path.watch.html], function(event, cb) {
gulp.start('html:build');
});
watch([path.watch.style], function(event, cb) {
gulp.start('style:build');
});
watch([path.watch.js], function(event, cb) {
gulp.start('js:build');
});
watch([path.watch.img], function(event, cb) {
gulp.start('image:build');
});
watch([path.watch.fonts], function(event, cb) {
gulp.start('fonts:build');
});
});
gulp.task('default', ['build', 'webserver', 'watch']);
Answer the question
In order to leave comments, you need to log in
There must be no spaces at the end of the include
//= template/tabs.html
It is also possible that some js file is missing (as an option, you need to do a bower update).
Most likely, the problem is in the work of Rigger when building js.
Remove all js files except for main.js in a separate folder.
The result should be:
src/
-- js/
-- -- main.js
-- -- plugins/
-- -- customize/
-- -- etc/
This is not a gulp file error, the exception comes from the root of the gulpa installation.
It is also possible that there are spaces in the path to your project in the folder names or in the files themselves.
/Users/User/Documents/work/portfolio Df/ - I got an error because of this
/Users/User/Documents/work/portfolioDf/
3 situations in which such an error occurs:
- The file extension is different from the one you are connecting the file
to - There are empty characters at the end of the path (I puzzled for a very long time when I was looking :) )
- Wrong path
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question