question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Task 'default' is not in your gulpfile

See original GitHub issue

Hello, I’m running node 0.12.7, npm 2.11.3 on Win7, and running this code returns a ‘Task default is not in your gulpf file’:

[11:43:50] Using gulpfile ~\Web\mywebsite\gulpfile.js
[11:43:50] Task 'default' is not in your gulpfile
[11:43:50] Please check the documentation for proper gulpfile formatting

This is the code

var gulp = require('gulp'),
watch = require('gulp-watch'),
jade = require('gulp-jade'),
less = require('gulp-less');

// functions ----------------------

gulp.task('default', ['compile']);

gulp.task('compile', function() {
    return gulp.src('./less/*.less')
    .pipe(less())
    .pipe(gulp.dest('./css'));
})

This are my installed modules:

├── browser-sync@2.7.13
├── gulp@3.9.0
├── gulp-coffee@2.3.1
├── gulp-jade@1.0.1
├── gulp-less@3.0.3
├── gulp-plumber@1.0.1
├── gulp-stylus@2.0.5
├── gulp-watch@4.3.3
├── lost@6.5.0
└── require-dir@0.3.0

Thanks

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

4reactions
ilovezycommented, Jul 19, 2015

maybe you should put the

gulp.task(‘default’, [‘compile’]);

after the compile task was defined? you can not bind the compile task into default before decare it?

0reactions
Romanxcommented, Jul 21, 2015

This is related to where the tasks are defined prior to their use. JS natively hoists variables as can be found here but i’m not sure if that is different for node/gulp i’d assume not.

This is another good example explaining complications here.

I think this should be closed as theirs nothing gulp can really do. You could use manual hoisting by defining name function variables as opposed to defining them in gulp.task that should cause them to be hoisted.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Task "default" is not in your gulpfile - Stack Overflow
When you just run gulp in your console it will look for a default task to run. You only defined live-server and serve...
Read more >
gulp not working: Task 'default' is not in your gulpfile #1107
(Maybe Stackoverflow might be a better place.) But your gulpfile needs to have a default task. So you may need to include gulp.task('default', ......
Read more >
task default is not in your gulp file - Blockchain Courses
The code looks correct to me. Make sure you installed gulp and gulp-cli globally with npm. So npm install -g gulp. Also the...
Read more >
Task 'default' is not in your gulpfile - Laracasts
You might have had a faulty install. Try deleting your node_modules directory, and doing npm install again. I've found myself too that most...
Read more >
Error: Task 'default' is not in your gulpfile - SugarClub
Error: Task 'default' is not in your gulpfile · Eugene Bychkov. 0 Eugene Bychkov over 3 years ago in reply to Marilia Girardi...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found