简体   繁体   中英

Nodejs. gulp not found after npm install

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?

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

如果你想在本地运行gulp,你可以在用npm install安装依赖项之后尝试这个:

$(npm bin)/gulp

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

uninstall nodejs application from your computer and then reinstall it again. the issue should be solve

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM