Alternatives to installing npm packages globally

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 director…


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.

[Read rest of post]


This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Alternatives to installing npm packages globally." Dr. Axel Rauschmayer | Sciencx - Saturday June 18, 2022, https://www.scien.cx/2022/06/18/alternatives-to-installing-npm-packages-globally/
HARVARD
Dr. Axel Rauschmayer | Sciencx Saturday June 18, 2022 » Alternatives to installing npm packages globally., viewed ,<https://www.scien.cx/2022/06/18/alternatives-to-installing-npm-packages-globally/>
VANCOUVER
Dr. Axel Rauschmayer | Sciencx - » Alternatives to installing npm packages globally. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/06/18/alternatives-to-installing-npm-packages-globally/
CHICAGO
" » Alternatives to installing npm packages globally." Dr. Axel Rauschmayer | Sciencx - Accessed . https://www.scien.cx/2022/06/18/alternatives-to-installing-npm-packages-globally/
IEEE
" » Alternatives to installing npm packages globally." Dr. Axel Rauschmayer | Sciencx [Online]. Available: https://www.scien.cx/2022/06/18/alternatives-to-installing-npm-packages-globally/. [Accessed: ]
rf:citation
» Alternatives to installing npm packages globally | Dr. Axel Rauschmayer | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.