Nicholas Ritson
Nicholas Ritson

Reputation: 909

Installing bower using Sudo

I did try and find a matching topic but couldn't find one. I am trying to install Bower, never used it before but wanted to get into it and same time learn more Sass on Bootstrap so thats why I'm installing it.

Installed npm, opened terminal and typed in the following:

npm install -g bower

But i get some errors and I'm told: to run as root/Administrator.

Looked around a bit and found some people saying to install it as Sudo, would i then use the line:

sudo -s npm install -g bower

(is that correct?)

and is it the right thing to do, there are plenty of warnings around the net about being very careful when using sudo commands so i wanted to just check before doing it.

Upvotes: 2

Views: 2100

Answers (1)

alandarev
alandarev

Reputation: 8635

option -s specifies the shell to run, that is something like: sudo -s /bin/bash npm ..., but you don't need that at all, use your default shell:

sudo npm install -g bower

Yes, it is fine and accepted pattern to use sudo for npm.

Installing software globally always carries some risk, but nobody reported anything very nasty regarding sudo npm as a consequence.

Upvotes: 4

Related Questions