These days, most front-end projects are going to involve NPM packages of some kind. Occasionally, when browsing documentation for these packages, I’ll see a recommendation to install a package like this.
yarn global add
Or like this.
npm install --global
In both of these examples, the package is installed globally. This means you can run the
command from any directory on your system.
This works, but installing packages globally has a couple downsides.
- If you’re working with a team of developers, it’s hard to guarantee everyone is running the same package.
- You can only have one version installed globally. This causes problems if you have different projects that rely on different versions of a package.