2

I'm trying to use node on my fedora 21 installation. However whenever I install a package via npm I am not able to to call that package such as gulp.

npm install -g gulp

then : gulp run

error:

zsh: command not found: gulp
Antarr Byrd
  • 20,852
  • 26
  • 85
  • 154

2 Answers2

2

The directory where npm installed gulp is not in your path. To find out where it was installed, run npm -g bin and make sure the directory is in your path. Alternatively, execute gulp as $(npm -g bin)/gulp.

Trott
  • 52,114
  • 21
  • 134
  • 179
2

You need to point your global $PATH variable to the location of node. Otherwise, it will return that error.

Open your .zshrc file and ensure you see something like PATH=/usr/bin/node:$PATH (ensuring your directory is the proper one for node). You can find that directory location with the command npm -g bin.

If that doesn't work, comment below. Thanks

Ben Rondeau
  • 2,793
  • 12
  • 20
  • I've tried that but still not luck `export PATH=/home/atbyrd/.npm/local/bin/bin:$PATH` – Antarr Byrd Apr 25 '15 at 04:46
  • When you run the command `npm install -g gulp`, do you get any errors? Also, when you run the `node` command, does it return any errors? – Ben Rondeau Apr 25 '15 at 04:49
  • I was able to get it to work by following [this post](http://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x) and reinstalling using nvm. – Antarr Byrd Apr 25 '15 at 05:02
  • Awesome. I was scratching me head with this one... sometimes you just reinstall and it works. Glad you got it working! – Ben Rondeau Apr 25 '15 at 05:03