1

I'm having a problem installing gulp globally with npm 5.3.0 and node v8.5.0.

First I did install gulp

$ npm install gulp-cli --global

then

$ gulp

results to

bash: gulp: command not found

I already tried answers from these questions:

  1. https://stackoverflow.com/a/24042936/8680741
  2. https://stackoverflow.com/a/40197889/8680741
  3. https://stackoverflow.com/a/25126461/8680741
  4. npm install and npm update

enter image description here

enter image description here

cha
  • 27
  • 9
  • This is what I did https://servimg.com/view/19521718/6 https://servimg.com/view/19521718/5 – cha Sep 28 '17 at 13:03
  • welcome to Stack Overflow. Please see [ask], the [Tour] and how to create an [mcve]. Particularly, don't link images of code, but if you must, at least inline them as I have done in the edit. It makes is easier to see what's going on. – msanford Sep 28 '17 at 13:17
  • Thanks @msanford I did what you suggested. I hope it's okay now. Please help me with this problem. Thank you. – cha Sep 28 '17 at 13:38
  • What version of nodejs and npm are you running: `npm -v && node -v`? – msanford Sep 28 '17 at 13:40
  • 1
    npm -v 5.3.0 && node -v v8.5.0 – cha Sep 28 '17 at 13:44
  • 1
    The problem is that your npm root (which I can't copy because it's an image ;) is not in your `PATH`. Add it in `~/.profile` https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path – msanford Sep 28 '17 at 13:51
  • Is `\Program Files\Git\usr\local\lib\` in your path ? – Francois Sep 28 '17 at 13:52
  • This is my $ npm root C:\Users\Jash\node_modules – cha Sep 28 '17 at 14:00
  • I'm really sorry I'm not sure what PATH you are talking about. Please explain it. – cha Sep 28 '17 at 14:19

1 Answers1

0

Make sure your Git Bash is listing global modules directory in your (~/.bash_profile, which is same as C:\Users\Jash\.bash_profile). I think, you will need to add a line in the very beginning of that file:

export PATH="/c/Program Files/nodejs/":$PATH
Igor Soloydenko
  • 11,067
  • 11
  • 47
  • 90