3

I've got this git repo : https://github.com/mschwarzmueller/angular-2-introduction .

Watching a series of tutorials and I got to the point where I must run gulp, but it gives me an error.

From the beginning I cloned this repo, then I did npm install being in that folder.

I inspected the package.json and indeed there are gulp dependencies.

So what should I do?

If I install gulp globally will it behave normally?

Or I must somehow install it locally?

P.S. : I tried this and encountered the error on Windows and Linux machine.

Katallone
  • 315
  • 2
  • 7
  • 15
  • Possible duplicate of [no command 'gulp' found - after installation](http://stackoverflow.com/questions/22224831/no-command-gulp-found-after-installation) – Brian Apr 06 '16 at 16:49

2 Answers2

11

If you want to run gulp locally you could try this after having installed dependencies with an npm install:

$(npm bin)/gulp
Thierry Templier
  • 198,364
  • 44
  • 396
  • 360
3

When you issue npm install module npm will install in current directory.

When you issue npm install -g module npm will install in the /usr/local/lib/node or /usr/local/lib/node_modules folders

It is recommended when using modules on command line interface installing them globally.

If you want to use it as a command line tool, something like the grunt CLI, then you want to install it globally. On the other hand, if you want to depend on the package from your own module using something like Node's require, then you want to install locally.

https://docs.npmjs.com/getting-started/installing-npm-packages-globally

That said if you wish to issue gulp commands on command line its possible instead of installing the 'gulp' module you may want the 'gulp-cli' module: https://www.npmjs.com/package/gulp-cli

d3l33t
  • 890
  • 6
  • 10