On Fri, Jun 13, 2014 at 7:06 AM, Sebastian Sester <sesters...@gmail.com> wrote:
since npm gets installed to /usr/local, I can't execute it without sudo. Also, changing the ownership of /usr/local/… to my user (as often suggested) won't help, since other users need to access it, too.
Because npm only needs elevated privileges when you’re installing packages globally (with -g
/ --global
), and because you should only do that when you need binaries exposed by those packages to be available systemwide, you should only need to use sudo comparatively infrequently. Most of the time, npm installs packages into the closest node_modules
directory. Are you running into a situation where this isn’t the case?
As an aside, you may want to build and install node from source. The Debian packaging of node is quirky, and using either the official binary tarball (if you don’t feel like installing build-essential
) or building from source is likely to be more straightforward in the long run.
F
Because npm only needs elevated privileges when you’re installing packages globally (with
-g
/--global
) [...] Are you running into a situation where this isn’t the case?
As an aside, you may want to build and install node from source. The Debian packaging of node is quirky, and using either the official binary tarball (if you don’t feel like installing
build-essential
) or building from source is likely to be more straightforward in the long run.