Ionic "serve" trouble in ionic 2.1

    When I start the serve command my gulp's hooks don't work. For example: 

gulp.task(‘serve:before’, function(cb)

But when I remove the scripts section from package.json the serve command works great again.

Steps to reproduce:

  1. Make some gulp task like this: gulp.task(‘serve:before’, function() {console.log(‘here’);});

  2. Add an empty script section inside package.json

  3. Call the ionic serve - there is no any message from the hook

  4. Remove the script section from package.json and call again the serve command. Now all works ok.

Which @ionic/app-scripts version are you using?

Cordova CLI: 6.3.1

Gulp version: CLI version 3.9.1

Gulp local: Local version 3.9.1

Ionic CLI Version: 2.1.1

Ionic App Lib Version: 2.1.1

Ionic App Scripts Version: 0.0.36

ios-deploy version: 1.8.4

ios-sim version: 5.0.6

OS: Mac OS X El Capitan

Node Version: v6.8.1

Xcode version: Xcode 8.0 Build version 8A218a

PS: This trouble is absent in ionic 2.0.0!

As we stated in the github issue.

Remove the scripts entry.
The cli does a check for either npm scripts or gulp tasks, but you cannot do both.

1 Like

I cannot remove the scripts entry because I use it for some helpers. Also I use gulp tasks, and it worked great before.How do the related the NPM scripts with gulp tasks ?

Same happening for me as well, on 2.1.0 it used to take the gulp task, but now after 2.1.1 its not considering anything.