Local versus global packages for Angular development

Viewed 1325

When developing with Angular, one can

npm install

to install packages locally, or

npm install -g

to install them globally. I am wondering what are the implications of each practice. And what happens if a particular package is installed both ways, perhaps with different versions? Which one will my Angular app use?

1 Answers

From there https://www.quora.com/When-do-I-install-a-package-locally-or-globally-in-NPM

In general, the rule of thumb is:
1. If you’re installing something that you want to use in your program, using import { 'whatever'}, then install it locally, at the root of your project.
2. If you’re installing something that you want to use in your shell, on the command line or something, install it globally, so that its binaries end up in your PATH environment variable.

Related