Bower and grunt globally or locally?

We don’t have nvm to not install anything globally, because we can work on many different projects at the same time, which requires different versions of the same libraries. But what about arbors and grunts? Throughout the Internet, I see npm install -g bower I know that grunting split into grunting and grunting some time ago, which should make the global package more stable. But what about the gazebo?

What are the best practices for working with such packages? How to avoid potential version conflicts? Or maybe I'm exaggerating the problem, and I should just use the -g option?

+6
source share
1 answer

Spoiler - globally.

Bower and grunt - development tools -

Bower is used for each frontend development procedure, so using it as a local package is simply wrong.

Grunt is divided into grunt and grunt-cli, the goal is to give you the opportunity to run grunts packaged in grunt-cli, while the code module is packaged in the ground and can be installed locally, but you can use it in others projects and install it locally several times.

In short, it is best to install the following packages around the world:

  • development tools
  • non-production packages
  • general packages installed globally on your hosting server - for example, you can install an express installed worldwide and use it in all other projects, but you need to make sure that it is global on your server (mention this in your package.json )
+6
source

Source: https://habr.com/ru/post/982563/


All Articles