Alternatives to installing npm packages globally

4 · Axel Rauschmayer · June 18, 2022, 5:21 p.m.
There are two ways in which npm packages can be installed: Locally, into a node_modules directory that npm searches for (or creates) in the current directory and its ancestors: npm install some-package Globally, into a global node_modules directory: npm install --global some-package (Instead of the long version --global of this flag, we can also use the shorter -g.) The latter requires root access on macOS and some other Unix platforms – which is a considerable downside. That’s why this ...