0

Ive forked a repo and run npm install. I can see gulp is installed in the node_modules folder. However when I run gulp or gulp -v on the command line it says command not found.

If I open a new terminal in a different folder (which is outside of the repo eg my home folder) and run gulp -v I can see the version:

CLI version 3.9.0

So it seems gulp is installed both locally and globally but its still not working. I have gulp working find on another project that I previously set up.

This is a similar question but the solution posed does not work: no command 'gulp' found - after installation

Community
  • 1
  • 1
Evanss
  • 23,390
  • 94
  • 282
  • 505

2 Answers2

1

After completely deleting and re-cloning the repo its now working. Im not sure why but I did add this line:

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

To my bash profile:

~/.bash_profile PATH="$HOME/.npm/bin:$PATH" 

And then on the command line ran:

npm config set prefix $HOME/.npm

This allows me to run npm install without sudo and so may or may not have fixed it.

Evanss
  • 23,390
  • 94
  • 282
  • 505
0

You need to install gulp globally, most probably using sudo

sudo npm install -g gulp

this will ensure the command is available to you as you want

A Macdonald
  • 814
  • 1
  • 7
  • 10
  • soudns like it's not - can you for example switch to another folder outside the repo and do gulp -v – A Macdonald Jan 06 '16 at 10:01
  • Yes I've done this and I get the result: CLI version 3.9.0. Im not sure why it seems to be unclear but I did say this in my original question. – Evanss Jan 06 '16 at 10:03
  • ok fair enough you didn't say the different folder was outside the repo - I would still run it again – A Macdonald Jan 06 '16 at 10:05