0

Why do my macs require me to type sudo before command line installs?

For example, the Yeoman website says to run the command npm install -g yo but it fails unless I type sudo as a prefix sudo npm install -g yo.

The same thing happens while installing compass or nodejs.

It's not like typing sudo is a big deal, but it appears not everyone is required to follow this step. Is there something I can do to avoid this?

Darren Cooney
  • 1,012
  • 16
  • 25

1 Answers1

1

Well the reason is simple: sudo means that you need root(admin) privileges. Thats to avoid that anybody can install softwares on your system. And I am not just talking about people, but more about softwares. It avoids that an other programm can install maleware/virus etc without your permission. It is actually a pretty good thing ;)

  • Ok makes sense, so you recommend keeping the sudo? I'll accept this answer. – Darren Cooney Apr 25 '14 at 17:32
  • For sure. It is alway recommendet to NOT use a root account. With sudo you can avoid a lot of security problems. On windows is sudo the "run as admin" window. It's almost the same. –  Apr 25 '14 at 17:41