Some things obviously you need to globally-install, but just because a package tells you to globally-install it, is that your only option?īeyond my personal feelings, globally-installing a package that your projects depend on is bad for two primary reasons: Global vs Local version mismatching ![]() ![]() I feel like I am polluting my OS or something… Or adding bloat… It’s hard to explain. Personally, I hate globally-installing things. I wouldn’t necessarily say it’s “bad” to globally-install a package, but I don’t think it’s a good idea. Over the next several years I ran into several packages that “needed” to be installed globally and eventually learned more details about this practice. Back in 2013, it seemed odd to me to need to install something “twice” to make it work… but I didn’t know much about Node.js so I just accepted it and moved on. You install Gulp globally so that you could run the # gulp command on your project. Install it locally in your project and also install it globally: # npm install gulp -save-dev # npm install gulp -g Like many, my first real exposure to Node was using Gulp to automate compiling of SASS to CSS. ![]() Is it a bad idea to install it globally? Does it matter? What are the advantages and disadvantages? What is the best alternative? How many times have you checked out a Node.js package and the instructions tell you to install it globally? # npm install some-cool-package -g Maybe don’t globally-install that Node.js package
0 Comments
Leave a Reply. |