Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zsh: command not found: gulp

I've installed zsh with homebrew and changed my shell to it. I'm having a problem when trying to run the gulp command, which worked before I changed the shell to zsh.

zsh: command not found: gulp

A bit of research leaves me to believe it has something to do with my PATH. My PATH looks like this is my .zshrc file.

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

I want to say I installed node with brew. How can I use gulp with zsh without changing back to the default shell?

Any help is appreciated. Thanks in advance!

like image 241
realph Avatar asked Apr 23 '15 08:04

realph


People also ask

Why is gulp command not found?

The problem might be caused by your global npm directory being set to the wrong location. The global npm directory is where your packages get installed when you install them globally. You can check where it is by typing in npm root -g in the command line.

How do I know if gulp is installed?

First run npm -g install gulp-cli then run gulp -v. Alternatively, you can just run npm list gulp.

How do I install gulp globally?

To install the Gulp CLI globally, on your command line, run npm install gulp-cli -g . The -g flag means npm will install the package in the global npm directory, so you can run the gulp command from any directory.


2 Answers

I did sudo npm install gulp -g, typed in my password, and after installing it worked for me.

like image 179
Darryl Mendonez Avatar answered Sep 21 '22 18:09

Darryl Mendonez


Though this is an old post, but none of the above solutions were working for me (Catalina 10.15.3). So basically issue with me wasn't about installing the gulp but not proper linking.

Commands I ran are:-

  1. npm config set prefix /usr/local

  2. npm link gulp

Hope this help anyone.

like image 44
Zaid Haider Avatar answered Sep 22 '22 18:09

Zaid Haider