FAQ
What's the issue with root owning the globally installed npm modules?
Permissions should be set by npm so that whatever utilities are still be
executable by your user.

Maybe it's common but I've never heard of anyone chowning /usr/local to
their main user. It seems especially dangerous if there's applications in
there that expect to run under their own special user account.

Personally, I wouldn't do that in Dev or Production. The way I see it
global installs from npm are used to install things to the PATH, like
applications, not necessarily to retrieve source code for development, like
regular installs. In the same way you need sudo to install from your system
repositories, you need sudo to install from npm globally.

I assume this is mainly because, correct me if I'm wrong, Linux is a multi
user system by nature. You don't want just anyone or any user account to
have access to edit the paths where shared user applications get installed.

Forcing everything to be owned by your user may prevent you from having to
type sudo but I'm not sure I see any other advantages.
On Jan 3, 2015 8:09 PM, "Dan Peddle" wrote:

I've dug around a bit, and there seems to be some different opinions about
whether or not to use npm with sudo - mainly to do with global installs,
creating symlinks etc.

For example, when setting up a new personal machine (mac or linux), I
would chown /usr/local to belong to my login user, hence not having to sudo
global npm actions. If I were to use the superuser later for whatever
reason, then that trumps any lower permissions, and so on.

What's the canonical opinion about this? Would this advice differ from
development environments to production ones..?

Dan








--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/CACTUpAfubXUsoHH46LJR39r9xbERqGe5W_Gsbz43yq%3D3As8bEQ%40mail.gmail.com
<https://groups.google.com/d/msgid/nodejs/CACTUpAfubXUsoHH46LJR39r9xbERqGe5W_Gsbz43yq%3D3As8bEQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAMT%3Dzo4Wr6URN%2BPyK1eYKLzwQ-QJ-_VxTSHcOTfretF-RG2Jog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 14 | next ›
Discussion Overview
groupnodejs @
categoriesnodejs
postedJan 4, '15 at 2:09a
activeJan 7, '15 at 2:28p
posts14
users6
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2022 Grokbase