Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jgravois's avatar

Error: Task 'hello' is not in your gulpfile

Trying to learn Elixir and I am trying to run a single task so, using the gulpfile below, I run gulp hello and am getting the error, Task 'hello' is not in your gulpfile. Would appreciate a little guidance.

var elixir = require('laravel-elixir');
var gulp = require('gulp');
var shell = require('gulp-shell');

var Task = elixir.Task;

var paths = {
    "assets": "./resources/assets/",
    "public": "./public/",
    "jquery": "./resources/assets/js/vendor/jquery/",
    "bootstrap": "./resources/assets/js/vendor/bootstrap/",
    "fontawesome": "./node_modules/font-awesome/"
}

elixir.extend('speak', function(message){
    new Task('speak', function(){
        return gulp.src('').pipe(shell('say ' + message));
    });
});

elixir.extend('hello', function(){
    new Task('hello', function(){
        console.log('First Gulp Task');
    });
});

elixir(function(mix) {
    mix
        .copy(paths.fontawesome + 'fonts/**', paths.public + 'fonts')
        .copy(paths.bootstrap + 'fonts/**', paths.public + 'fonts/bootstrap/')
        .sass(['app.scss','simple-sidebar.scss'])
        .scripts([
                paths.jquery + 'dist/jquery.min.js',
                paths.bootstrap + 'dist/js/bootstrap.js',
                paths.assets + 'js/sidebar-menu.js'
            ], 'public/js/app.js')
        //.phpUnit()
        .speak('Compilation complete!');
});

0 likes
2 replies
bobbybouwmann's avatar
Level 88

You can't run it like that. You extend elixir here not gulp! That is a big difference. You created a hello function for elixir. If you want to call it you can do that like so

elixir(function(mix) {
    mix.hello();
});

If you want to add a gulp task you need to update your gulpfile.js ;)

// gulpfile.js

gulp.task('hello', function() {
  //do stuff
});

// You can then run: gulp hello

This is a nice place to find some examples: https://scotch.io/tutorials/automate-your-tasks-easily-with-gulp-js

Please or to participate in this conversation.