When you put something into a directory like /usr/local/bin, it’s certainly convenient for you the software becomes immediately available no matter where you are on the system with no further action on your part.īut while it’s easy for you to use that software anywhere, it also becomes easy for other software elsewhere on your system-even software that’s very locally scoped-to pick up on the software you’ve installed. Global Installs Affect Everything on Your ComputerĮven though most of our Unix-like systems are no longer used by multiple users, they are still used for a wide variety of software. “Sudo install is like using global variables to manage state.”Īnd though npm install -g, run as your user account with no root privileges, is safer than using sudo to install all the things, it’s still better to invoke it as rarely as you can. My friend Trenton Broughton once put it thus: But too often, it’s used to change global state on the operating system when local state would suffice. It helps narrow down the scope of tasks performed as the superuser. As I went through that otherwise solid documentation, I was unsettled by the number of times I was asked to invoke an installation command prefixed with sudo.ĭon’t get me wrong Sudo is a great piece of software. I last wrote about this pattern in 2014, just before I became an Atom, as I was working through the Ruby on Rails tutorial. The pattern’s telltale sign: npm install -g. It’s an old pattern-one I’ve seen many times in many different contexts over my decades of working on Unix-like systems-but it seems even more common now that OS X is the development platform of choice. This ecosystem is certainly vibrant, with lots of interesting things going on all the time, but I’m concerned about a pattern that I see popping up when people write about it. I’ve been doing some reading lately on new (to me) tools in the Node.js ecosystem.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |