Gulp TypeError: Arguments to path.join must be strings

With the syntax changes in gulp-ruby-sass starting from 1.0.0-alpha, you’ll need to use gulp-ruby-sass() instead of gulp.src() to compile your Sass from a file or directory. If you try to use the original syntax with newer or latest versions, you may encounter the following error: TypeError: Arguments to path.join must be strings For example, the … Read more

How do I install gulp 4

# Uninstall previous Gulp installation and related packages, if any $ npm rm gulp -g $ npm rm gulp-cli -g $ cd [your-project-dir/] $ npm rm gulp –save-dev $ npm rm gulp –save $ npm rm gulp –save-optional $ npm cache clean # for npm < v5 # Install the latest Gulp CLI tools globally … Read more

How can Gulp be restarted upon each Gulpfile change?

You can create a task that will gulp.watch for gulpfile.js and simply spawn another gulp child_process. var gulp = require(‘gulp’), argv = require(‘yargs’).argv, // for args parsing spawn = require(‘child_process’).spawn; gulp.task(‘log’, function() { console.log(‘CSSs has been changed’); }); gulp.task(‘watching-task’, function() { gulp.watch(‘*.css’, [‘log’]); }); gulp.task(‘auto-reload’, function() { var p; gulp.watch(‘gulpfile.js’, spawnChildren); spawnChildren(); function spawnChildren(e) { … Read more

How to Gulp-Watch Multiple files?

gulp.task(‘default’, [‘css’, ‘browser-sync’] , function() { gulp.watch([‘sass/**/*.scss’, ‘layouts/**/*.css’], [‘css’]); }); sass/**/*.scss and layouts/**/*.css will watch every directory and subdirectory for any changes to .scssand .css files that change. If you want to change that to any file make the last bit *.*

Everytime I run gulp anything, I get a assertion error. – Task function must be specified

Gulp 4.0 has changed the way that tasks should be defined if the task depends on another task to execute. The list parameter has been deprecated. An example from your gulpfile.js would be: // Starts a BrowerSync instance gulp.task(‘server’, [‘build’], function(){ browser.init({server: ‘./_site’, port: port}); }); Instead of the list parameter they have introduced gulp.series() … Read more