> On Jan 5, 2015, at 3:45 PM, Sam Roberts <[email protected]> wrote:
> 
> On Sun, Jan 4, 2015 at 9:51 AM, Christopher Rust <[email protected]> wrote:
>> Maybe it's common but I've never heard of anyone chowning /usr/local to
>> their main user.
> 
> Let me introduce you to Isaac Schlueter:
> http://foohack.com/2010/08/intro-to-npm/
> 
> And almost everyone I know.

I think there's a strong argument for chowning /usr/local to a user's ownership 
on a single-user machine, and to leave it as root (or staff-owned) on a shared 
one.

> If you are setting up a production machine, probably best to install
> node as root, and if absolutely necessary to do any npm global
> installs (should be rare), run the global installs as root, or with
> sudo, and use --unsafe-perm so that scripts run with sufficient privs
> to succeed, and so that the ~/.npm/ cache is writeable.

As a heads up: --unsafe-perm is the default when run as root. You don't need to 
specify it.

>> 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.
> 
> Some advantages:
> 
> - a number of npm install scripts will fail when run with sudo,
> because they are run with privs of nobody, and can't write to the fs,
> the symptoms of which can be subtle and maddening to debug. I speak
> from sad experience, here.

Yeah, this is painful. Beware!

> - avoiding your .npm cache from containing a mix of root and user-owned 
> packages

This was a bug in earlier npm; upgrade to the latest and this won't happen.

Aria

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/7DBB6EE3-2727-4BE1-89C5-9B15AF4A9280%40nbtsc.org.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to