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.

Gulp task problem with del

See original GitHub issue

Sincerely, I’m not so sure if this error is from this package or gulp. But you can help me. When I call my gulp task clean

gulp.task('clean', cb => {
  del(['.tmp', 'dist/*', '!dist/.git'], {dot: true}).then(cb);
});

I get this:

[01:28:16] Requiring external module babel-core/register
[01:30:33] Using gulpfile d:\www\web-starter-kit\gulpfile.babel.js
[01:30:33] Starting 'clean'...
[01:30:34] 'clean' errored after 325 ms
[01:30:34] Error
    at formatError (C:\Users\ramasilveyra\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:169:10)
    at Gulp.<anonymous> (C:\Users\ramasilveyra\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:195:15)
    at emitOne (events.js:77:13)
    at Gulp.emit (events.js:169:7)
    at Gulp.Orchestrator._emitTaskDone (d:\www\web-starter-kit\node_modules\gulp\node_modules\orchestrator\index.js:264:8)
    at d:\www\web-starter-kit\node_modules\gulp\node_modules\orchestrator\index.js:275:23
    at finish (d:\www\web-starter-kit\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:21:8)
    at cb (d:\www\web-starter-kit\node_modules\gulp\node_modules\orchestrator\lib\runTask.js:29:3)

Maybe a problem with the promise?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
adamreisnzcommented, Nov 7, 2015

I’m using it this way (with gulp 4) and the task is run in series, e.g.:

function clean() {
  return del(destination);
}

gulp.task('build', gulp.series(
  clean,
  gulp.parallel(
    buildStatic,
    buildAppJs, buildAppScss,
    buildVendorJs, buildVendorCss
  ),
  buildIndex
));
gulp.task('default', gulp.series(
  gulp.parallel('lint', 'test'), 'build', gulp.parallel('watch', 'start')
));

However, since I adopted this new API I keep getting the following error when I first run the task (running it a second time after it causes no problems):

[11:01:27] Starting 'clean'...
[11:01:27] 'clean' errored after 37 ms
[11:01:27] Error: ENOTEMPTY: directory not empty, rmdir '/Users/Adam/Sites/some-site/public'
  at Error (native)

Any thoughts? Needless to say that the test & lint tasks don’t interact with the public folder at all, so I’m not sure why this error is thrown.

0reactions
adamreisnzcommented, Nov 10, 2015

Have retested several times today but did not manage to reproduce anymore. I did have a lot of Finder windows open yesterday, so that may have been the cause. I’ve tested with two open windows now, each showing the relevant folder, but it didn’t seem to cause any issues anymore. If I encounter it again I will report back with further information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using del in gulp.series() - Stack Overflow
It doesn't work, because 'clean' task must return some stream. I've found workaround: gulp.task('clean', function() { del.
Read more >
Create a gulpfile and Write gulp Tasks Using TypeScript
Learn how to create gulp files in TypeScript and how to define gulp tasks in a class-based style.
Read more >
How to Migrate to Gulp.js 4.0 - SitePoint
Consider tasks which don't return the gulp streamed value. For example, a clean task to delete the build folder: const gulp = require( ......
Read more >
Running Gulp tasks in series (Example) - Coderwall
#gulp. I ran into a problem today for minifying and concatenating for a CSS library, as I wanted the tasks to run in...
Read more >
Using Gulp 4 in your workflow for Sass and JS files
If you can, I'd recommend updating your syntax to reflect this, as it's possible that Gulp will deprecate task() at some point. Problems...
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