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 series does not update things unless the last task is run

See original GitHub issue

Hi! I do not know if it is a bug, however I cannot find any information bout this behavior in the docs and it might be a bug, namely, I’ve got such gulp tasks:

gulp.task 'incVersionDev', (done) ->
  gulp.src './package.json'
    .pipe transform 'utf8', incVersionDev
    .pipe gulp.dest('.')
  done()

gulp.task 'publish' , gulp.series 'build', 'incVersionDev', 'copy_package_config', (done) ->
  # execSync 'cat ./package.json', {stdio:'inherit'}
  execSync 'cd lib && npm publish', {stdio:'inherit'}
  done()

when I run gulp publish I got npm error that I cannot publish the same version twice. What happens is that incVersionDev runs but it do not writes package.json unless are series tasks are run. If I uncomment echo of package.json I can clearly see it was not changed. However if I comment the line execSync 'cd lib && npm publish', {stdio:'inherit'}, everything works - the version is incremented.

It seems like gulp is not making changes to files when running series until series is finished - if that is the case, is it the behavior we want? If so, is there any way to accomplish what I want to do here?

gulp version: next npm version: 5.5.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
phatedcommented, Jan 28, 2018

@wdanilo you’ve fixed your stream issue (of course, you’re relying on implicit returns). For your other issue: this is not a support forum. Support questions should be directed to StackOverflow, but you might want to look into your usage of npx inside the publish script.

0reactions
wdanilocommented, Feb 11, 2018

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gulp tasks not running in series - Stack Overflow
My question assumes that the syntax for the parent task handles ordering. Evidently it does not. You need to explicitly restate the order...
Read more >
gulp.series() could be friendlier to run inside a function #2116
This doesn't work because gulp.series() returns a function, and the execution of a task is expected to return a promise or a stream....
Read more >
How to Upgrade to Gulp 4 - Create default, parallel ... - YouTube
... parallel, series, and watch tasks. Watch later. Share. Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly, ...
Read more >
series() - gulp.js
When the composed operation is executed, all tasks will be run sequentially. If an error occurs in one task, no subsequent tasks will...
Read more >
Getting Started with Gulp.js - Semaphore Tutorial
Learn how to set up and use Gulp.js, a task runner for Node.js based on Node streams. We'll introduce main concepts of Gulp...
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