sudo npm install -g chown ~/tmp to root on ubuntu #4572

Closed
allaire opened this Issue Jan 29, 2014 · 1 comment

Projects

None yet

2 participants

@allaire
allaire commented Jan 29, 2014

When running sudo npm install -g foo on ubuntu 12.04, it creates the ~/tmp directory with the rootuser. that cause problem when you then try to install packages locally without sudo (npm install bar), since the ~/tmp directory is owned by root.

My current solution is I don't install npm global packages with sudo, I install them directly under the root user (sudo su - and then run npm install -g foo)

I once had the same issue with the ~/.npm directory, but it is now fixed. (maybe we need the same fix for ~/tmp ?). (Similar issue: #3537 & PR: #3506 — maybe @domenic can advice?)

Oh and, I would like to know why on ubuntu, npm use ~/tmp instead of /tmp

npm config ls -l returns by default:
tmp = "/home/my-user/tmp"

npm version: 1.3.25
ubuntu 12.04

Thank you.

@allaire
allaire commented Jan 29, 2014

Looks like it's already reported: #3470

Confirm it's dup and I'll close the issue :)

@allaire allaire closed this Jul 1, 2014
@othiym23 othiym23 added the support label Sep 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment