3

I am developing a Magento website using Vagrant and Puppet to manage my dev environment.

I am using the Magento Boilerplate theme (https://github.com/webcomm/magento-boilerplate) as a base, which uses Gulp.js to run automatic compilation of LESS and JS files.

I am running gulp from the host machine as this has the full suite of node, npm, etc installed, but I get the following error:

stream.js:94
  throw er; // Unhandled stream error in pipe.
        ^
[gulp] Error in plugin 'gulp-notify': No reporter specified.

The host machine is Ubuntu 12.04 and the Guest is CentOS. The host has the required notify-send package installed and the guest has libnotify, but gulp does not seem to recognise either.

I am new to gulp having used Grunt in the past, so may be missing something here.

AppSol
  • 316
  • 1
  • 4

1 Answers1

0

gulp-notify is intended to be run on a desktop environment, with a notifier. It makes no sense to have it on a headless server.

You can use the gulp-if plugin and the gulp-util library along with a production / development flag to prevent gulp-notify from being run on the server.

Set it up like so:

var _if = require('gulp-if'),
    gutil = require('gulp-util');

var production = gutil.env.production;

//...

     // use like so in your pipe:
    .pipe(_if(!production, notify('...')))

Then, run it like this on your server:

gulp --production

If you'd prefer to be cautious, you can reverse it so that you test for --dev (gutil.env.dev) and only enable it when that is true.

OverZealous
  • 39,252
  • 15
  • 98
  • 100
  • Thanks @OverZealous, if nothing else I like the way you handle environments there. However, to respond to your opening comment I am running the grunt task from my desktop, not the VM as Vagrant has created synced folders. If I take out all the gulp-notify references the gulp tasks run fine. It just doesn't seem capable of recognising my install of notify-send. – AppSol Mar 13 '14 at 12:46
  • I've never tested gulp-notify on vagrant, but there is an blogpost on using it here: jpbetley.com/vagrant-gulp-notifications – mikaelb Mar 27 '14 at 09:27