L
L
Leonid Frolov2014-12-25 20:29:17
Node.js
Leonid Frolov, 2014-12-25 20:29:17

How to use Gulp and its modules globally without installing them in every project?

I have been using CodeKit for various front-end tasks for a long time - compiling less / scss and coffeescript, concatenation-minification, livereload. And everything would be fine, but there was not enough flexibility, I want new features, to be in trend and in general. I decided to figure it out and set up Gulp, but I came across the fact that for each project I need to store my own versions of modules, and this does not suit me at all.

  • I have many small-medium projects
  • I want to always have fresh versions of plugins and update them in each project, I don’t need to install them for each new project
  • Why do I need a whole directory with a bunch of files in each project that are not part of the project?

Is there a kosher way to keep only a gulp.js file in the root of each project that will work with globally installed modules?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
index0h, 2014-12-25
@index0h

Generally speaking you can install gulp and other packages globally
However, this is a road to nowhere and I do not recommend doing this. One fine moment, you update the version of one of the packages unsuccessfully, and all your projects will die at once, and so - only one. That's why I don't recommend shooting yourself in the foot.

V
vsvladimir, 2014-12-26
@vsvladimir

You can try this: make a folder "Group of small projects" and place folders with projects in it. And install Gulp and other common modules in this group folder.

S
sasha, 2014-12-28
@madmages

npm i xxx -g
although if you are doing a PROJECT, then it is recommended to pass these dependencies into pakage.json so that later, when you deploy this project somewhere else, everything can be assembled on a combat server with the npm i command,
but if homemade crafts, then just set the global flag. Although, as far as I remember, some modules require a local version and a global one (I'm not sure about the gallop modules, but some of the node ones for sure)

V
victor8888, 2019-03-23
@victor8888

Correct me if I am wrong. Suppose we have packages installed globally. We have a small project that one developer is working on and is not particularly important at all. Then we work with gulp and all dependent packages globally. But nothing prevents us from deploying gulp in isolation in another project with the installation of dependent packages locally according to the package.json configuration.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question