0

I install gulp using npm install -g gulp

[npm WARN deprecation warnings redacted]
/usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp/bin/gulp.js
/usr/local/lib
└── [email protected] 

When I try to run the gulp command I get:

gulp
[19:42:23] Local gulp not found in ~/javascript
[19:42:23] Try running: npm install gulp

But when I install another npm package globally, it works. For instance when I install create-react-app like so:

npm install -g create-react-app
/usr/local/bin/create-react-app -> /usr/local/lib/node_modules/create-react-app/index.js
/usr/local/lib
└─┬ [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ └── [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├── [email protected] 
  └── [email protected] 

When I run the command after installation it works:

create-react-app
Usage: create-react-app <project-directory> [--verbose]

Is there any reason why gulp would screw out?

Simpleton
  • 6,285
  • 11
  • 53
  • 87
  • Where is the `npm` bin located at? Type `npm bin -g` and when you get the output, try running the command directly from that path, e.g. on my laptop here is where it's located: `/home/kyle/.linuxbrew/bin`. So I can just run `/home/kyle/.linuxbrew/bin/gulp` and it will run. If you're not seeing this command, it likely means you don't have this path setup in your `$PATH` variable, so you'll need to edit your `.bash_profile` (or appropriate file if you put this somewhere else or use Zsh or another shell). – Kyle Anderson Aug 12 '16 at 17:53
  • the npm bin path is in my $PATH – Simpleton Aug 12 '16 at 17:55
  • Possible duplicate of [Why do we need to install gulp globally and locally?](http://stackoverflow.com/questions/22115400/why-do-we-need-to-install-gulp-globally-and-locally) – Sven Schoenung Aug 12 '16 at 18:15

1 Answers1

1

You have to install the Gulp CLI to get the command line to work npm install -g gulp-cli

Dave V
  • 1,966
  • 9
  • 18
  • 1
    It just may not work that way. Even their tutorial says to install the CLI globally then Gulp as a package dependency. I've always had both installed, never tried to do it with just the global installation – Dave V Aug 12 '16 at 17:59