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

Akeno's avatar

Gulp - cannot find module notify-send

Hi, I installed gulp by following the instructions on the documentation.

But when I now try to run

gulp

I get this error:

Error: Cannot find module './lib/notifiers/notify-send'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/vagrant/Projects/Avalon/node_modules/laravel-elixir/node_modules/gulp-notify/node_modules/node-notifier/index.js:2:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Any ideas how to fix this? I can't find any solution on the internet

Thank you

0 likes
11 replies
sitesense's avatar

Try running npm install again. Looks like one or more of the node modules didn't get copied correctly.

Akeno's avatar

Hm, it gives me this warning:

npm WARN package.json @ No repository field.
sitesense's avatar

That warning shouldn't be anything to worry about. Many package.json files don't contain the repository field.

Akeno's avatar

Okay but that's all it says :( I have no idea why it's not working

Edit: Is it normal that I have a "node_modules" folder in the Application's root folder and then another here:

/node_modules/gulp/node_modules

sitesense's avatar

Yup, that's normal.

Are you using a VM like Homestead?

If so, try running npm install --no-bin-links in the VM via SSH - obviously cd to your applications root folder first.

bashy's avatar

Yes it's normal.

The previous warning was fixed in an update to Laravel

Akeno's avatar

Yea, I'm using homestead.

It did not work :/ Everything is still as it was before-

It really got fixed? Because I downloaded laravel just some hours ago and the error is still in the app.

Akeno's avatar

That's strange.

I tried it locally as well and it didn't work :(

Akeno's avatar
Akeno
OP
Best Answer
Level 2

Okay, now it works. I have no idea why but it works.

The last commands I typed:

sudo npm update sudo npm install -g gulp sudo npm install -g notify-send

Not inside the VM, but outside, in my normal root folder

bashy's avatar

Try not to use sudo with npm install. If it says you have to, set your prefix to your home directory

npm config set prefix ~/npm

adding $HOME/npm/bin to $PATH (append to .bashrc/.zshrc or similar)

export PATH="$PATH:$HOME/npm/bin"

Please or to participate in this conversation.