I’m following examples that use the -g flag when using npm install but I can’t figure out through the help system what the -g flag is doing.
I’m following examples that use the -g flag when using npm install but I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
-gtellsnpmto install the named module so that it’s accessible globally.But it’s important to understand that
-gis typically only used for packages that provide command-line utilities so that their executable components are available in the systemPATH.If you have multiple programs that
requirethe same package, each program should install the package locally. If you really want to share an installed package by installing it globally, you have to also usenpm link.See the docs on the topic of globally installed packages here.