This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer
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 blog post explores alternatives to global installs.
This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer
Dr. Axel Rauschmayer | Sciencx (2022-06-18T00:00:00+00:00) Alternatives to installing npm packages globally. Retrieved from https://www.scien.cx/2022/06/18/alternatives-to-installing-npm-packages-globally/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.