grunt-notify icon indicating copy to clipboard operation
grunt-notify copied to clipboard

Errors with Grunt Watch

Open emagnier opened this issue 11 years ago • 1 comments

I'm using [email protected], [email protected] and [email protected] on Mac OS X 10.9 (and the notification center).

When making grunt watch I get this error:

Running "watch" task
Waiting...

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: EMFILE, too many open files '/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/platforms/growl-notify.js'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.readFileSync (fs.js:284:15)
    at Object.Module._extensions..js (module.js:473:44)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at choosePlatform (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/notify-lib.js:27:22)
    at postNotification (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/notify-lib.js:70:22)
    at notifyHook (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/hooks/notify-fail.js:104:12)

I'm also using Sails.js, and when it load the "watch" task (via the sails lift command) I also get an error:

verbose: Grunt :: Running "notify:server" (notify) task
verbose: Grunt :: Running "watch" task
verbose: Grunt :: Waiting...
error: Grunt :: 

error: Grunt :: child_process.js:935

error: Grunt ::     throw errnoException(process._errno, 'spawn');

error: Grunt :: ^

error: Grunt :: Error: spawn EMFILE
    at errnoException (child_process.js:988:11)
    at ChildProcess.spawn (child_process.js:935:11)
    at exports.spawn (child_process.js:723:9)
    at module.exports (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/util/spawn.js:13:15)
    at Object.notify (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/platforms/notification-center.js:65:3)
    at postNotification (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/notify-lib.js:91:25)
    at notifyHook (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/hooks/notify-fail.js:104:12)
    at Object.watchForContribWatchWarnings (/Users/emagnier/Projects/Website/node_modules/grunt-notify/lib/hooks/notify-fail.js:32:16)
    at Object.hooked [as writeln] (/Users/emagnier/Projects/Website/node_modules/grunt/node_modules/hooker/lib/hooker.js:108:32)
    at Object.grunt.fatal.grunt.fail.fatal (/Users/emagnier/Projects/Website/node_modules/grunt-contrib-watch/tasks/lib/taskrunner.js:322:17)

I'm not sure if these errors come from the notify or the watch task. In the error messages there is a couple mentions of grunt-notify, but if I downgrade the watch plugin to 0.4.4 the problem disappears...

emagnier avatar Mar 24 '14 21:03 emagnier

I was also having the same issue and downgrading grunt-contrib-watch to 0.4.4 fixed it.

I also removed grunt-notify completely, used the latest grunt-contrib-watch (master) and still had issues:

Running "watch" task
Waiting...
>> File "src/app/fooBar.js" changed.
Fatal error: spawn EMFILE

I think this is a bug with grunt-contrib-watch

tjwallace avatar Jul 30 '14 20:07 tjwallace