Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ovvessem's avatar

Laravel Elixer - gulp watch error in Homestead

Hi Laravel community,

I am using the new Elixer in a fresh Laravel 5 install through Homestead. When I try to execute the command gulp watch I receive the following error

vagrant@homestead:~/sites/laravel5-dev$ gulp watch
[20:09:04] Using gulpfile ~/sites/laravel5-dev/Gulpfile.js
[20:09:04] Starting 'sass'...
[20:09:05] Starting 'routeScanning'...
[20:09:05] Starting 'eventScanning'...
[20:09:06] gulp-notify: [Laravel Elixir]
[20:09:06] Finished 'sass' after 1.37 s
[20:09:06] gulp-notify: [Error in notifier] Error in plugin 'gulp-notify'
not found: notify-send
Events scanned!
[20:09:06] Finished 'eventScanning' after 965 ms
Routes scanned!
[20:09:07] Finished 'routeScanning' after 1.04 s
[20:09:07] Starting 'watch'...
[20:09:07] Finished 'watch' after 81 ms

Events and Routes are scanned correctly. The 'problem' is that gulp-notify won't execute because of a missing dependency.

Does anyone else experiencing this behaviour and what is the solution to tackle this issue? Should I run the command from my local /sites folder with npm and gulp installed globally?

0 likes
16 replies
xingfucoder's avatar

I had the same issue with 'gulp-notify' although I think the eventScanning is working.

noeldiaz's avatar
Level 23

I think you can't run gulp-notify from inside a VM. You need to run the watch task from the shared directory of code on the host system. I don't think they have a way for notifications inside the VM to bubble up to the host.

3 likes
Alias's avatar

This is what I thought when I watched the video, but thought there might have been something clever going on to deal with this. In my opinion, if it doesn't work with Homestead then it should really be in there.

Also, does it even deal with Windows computers? Or will it throw an error if there is nothing like Growl installed?

Alias's avatar

@noeldiaz there is, but it shouldn't really rely on 3rd party plugin to work. There is still loads of Windows developers out there, you can't just assume someone will be using a mac or have growl installed.

noeldiaz's avatar

@Alias it is true what you say, and I think some of those possibly incompatible settings should be set up somewhere where they can easily be enabled/disabled. Notify is the only problem with running it from a VM I think, so the watch task could be running there and you can just keep an eye on the console log. Maybe the gulpfile could have a small config section on top to just turn on/off features like that, instead of hunting them down in the code? Or a default sample for unix based systems and one for windows based?

simondavies's avatar

Any more news on this as I can try and run it on my desktop terminal, but then my tests fail, and also events/route scanners due to the mycrypt / iMac PHP version etc At moment I've disabled all the notify commands in gulp but be nice to have them back.

simondavies's avatar

Well running npm update did not solve the issue still getting

     gulp-notify: [Error in notifier] Error in plugin 'gulp-notify'

not found: notify-send

When running gulp from the VM, and then when running form my Host machine notifier works just that then i get the

       Mcrypt PHP extension required.

Messages when running the scanning and phpunit test gulp commands.

At the moment seems i might have to remove the Notify instruction form the elixer gulp files and do a simple terminal output until i can sort this out. :-(

simondavies's avatar

Following the issue above works for me but each time i restart my VM it then gives me the following error:

     "The SSH connection was unexpectedly closed by the remote end. This

usually indicates that SSH within the guest machine was unable to properly start up. Please boot the VM in GUI mode to check whether it is booting properly"

And i have to somehow stop the ruby process from running etc and its a bit long and effort to get the VM up again, just incase you are going to try this or are having the same issue

to do this i have to do the following:

find the ruby thats running:

  lsof -i TCP

its should list a lot but get the number after the name 'ruby' then type in

 kill (followed by the number)

eg:

kill 1161

Then you might have to stop the VM and then restart it again.

1 like
martialc's avatar

@Alias : Windows 8.1 has native notifications, Gulp/Grunt notifications plugin uses that correctly, so elixir notifications works out of the box for 8.1. Earlier versions of windows don't have that, so developers on those systems will need growl for windows as a fallback.

1 like
Vetster's avatar

This fixed it for me in Mac OS X: sudo apt-get install libnotify-bin

Please or to participate in this conversation.