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

jimmy.puckett's avatar

Getting a "Local gulp not found in..." error working with the Bower lesson

I am trying to work along with the new Bower lesson, and I have installed gulp globally, but when I run "gulp watch" I get error..

laravel-5 [develop] :) gulp watch
[07:55:04] Local gulp not found in ~/Documents/GIT/laravel-5
[07:55:04] Try running: npm install gulp
laravel-5 [develop] :)

This is really my first interaction with gulp, so I am probably missing a step, but I have rewetted the video a few times & cannot see what I am doing wrong.

0 likes
5 replies
jimmy.puckett's avatar

So, I guess that I was missing 2 steps...

laravel-5 [develop] :) npm install
...
laravel-5 [develop] :) bower install
...
laravel-5 [develop] :) 

Now I can run gulp watch.

My question is now I see a gulp in node_modules, so does installing it globally really do anything?

arabsight's avatar
Level 10

Installing gulp globally gives you access to gulp’s CLI, that's why you just type gulp or gulp watch and it works.

1 like
jimmy.puckett's avatar

Then why is there a second gulp JS in the node_modules folder?

isimmons's avatar

I think it's because other node modules when using gulp as a variable (gulp = require('gulp')), will look for it in the node_modules directory rather than looking for a globally installed gulp. So the only reason for the globally installed one is as arabsight says, to have CLI access to the gulp command.

I'd be interested to know why node modules can't just use the globally installed gulp instead though. I guess there are instances where you need gulp in a node module but don't need the CLI command and you would want those modules to work even if gulp is not installed globally ?

1 like
superyaro's avatar

You can link the global gulb locally:

npm link gulp
7 likes

Please or to participate in this conversation.