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.

4

1 回答 1

0

gulp-notify旨在在带有通知程序的桌面环境中运行。将它放在无头服务器上是没有意义的。

您可以使用插件gulp-if以及gulp-util生产 /开发标志来防止gulp-notify在服务器上运行。

像这样设置它:

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

var production = gutil.env.production;

//...

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

然后,在您的服务器上像这样运行它:

gulp --production

如果您更愿意谨慎,可以将其反转,以便测试--dev( gutil.env.dev) 并仅在为真时启用它。

于 2014-03-11T22:35:40.567 回答