npm fails to install if there is a file named 'tmp' in the user's HOME directory #3470

Closed
spullara opened this Issue May 22, 2013 · 9 comments

Projects

None yet

6 participants

Error message looks like:

npm ERR! Error: ENOTDIR, mkdir '/home/siddharthsaha/tmp/npm-28554/1353323290836-0.20847953506745398'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-@googlegroups.com

http://stackoverflow.com/questions/13452791/npm-install-error-enotdir

Member
domenic commented May 27, 2013

Huh, seems bad; I wonder why we're not using the usual temp directories via environment variables and such. Thanks for finding this and sorry for the trouble it caused.

Member

this one bite me also in #3407 - I can write a patch tonight.

@robertkowalski robertkowalski added a commit to robertkowalski/osenv that referenced this issue May 29, 2013
@robertkowalski robertkowalski Use os.tmpdir() for temp-dirs
The former implementation preferred /home/{username}/tmp on unix
which caused errors for users that had different permissions on
their tmp-folder in their home, like root as owner from a previous
sudo-command.

The new implementation uses os.tmpdir()

This fixes: npm/npm#3470
83ab587
@robertkowalski robertkowalski referenced this issue in npm/osenv May 29, 2013
Closed

Use os.tmpdir() for temp-dirs #3

@robertkowalski robertkowalski added a commit to robertkowalski/osenv that referenced this issue May 31, 2013
@robertkowalski robertkowalski Use partially os.tmpdir() for temp-dirs
The former implementation preferred /home/{username}/tmp on unix
which caused errors for users that had different permissions on
their tmp-folder in their home, like root as owner from a previous
sudo-command.

The new implementation uses os.tmpdir() if it is available

This fixes: npm/npm#3470
80eef9c
@robertkowalski robertkowalski added a commit to robertkowalski/osenv that referenced this issue Jun 5, 2013
@robertkowalski robertkowalski Use os.tmpdir() for temp-dirs
The former implementation preferred /home/{username}/tmp on unix
which caused errors for users that had different permissions on
their tmp-folder in their home, like root as owner from a previous
sudo-command.

The new implementation uses os.tmpdir()

This fixes: npm/npm#3470
8de74a2
allaire commented Mar 2, 2014

Any news on this?

Member
KenanY commented Mar 2, 2014

Still waiting on npm/osenv#4 I believe.

allaire commented Mar 2, 2014

Thanks @KenanY for the info!

allaire commented Mar 2, 2014

My current solution is to install global packages under the root user instead of using sudo.

@robertkowalski robertkowalski added a commit to robertkowalski/osenv that referenced this issue Mar 2, 2014
@robertkowalski robertkowalski Use os.tmpdir() for temp-dirs
The former implementation preferred /home/{username}/tmp on unix
which caused errors for users that had different permissions on
their tmp-folder in their home, like root as owner from a previous
sudo-command.

The new implementation uses os.tmpdir()

This fixes: npm/npm#3470
ccf331a
Contributor
rlidwka commented Mar 7, 2014

My current solution is to install global packages under the root user instead of using sudo.

You can use sudo -i then.

@robertkowalski robertkowalski added a commit to robertkowalski/osenv that referenced this issue May 26, 2014
@robertkowalski robertkowalski Use os.tmpdir() for temp-dirs
The former implementation preferred /home/{username}/tmp on unix
which caused errors for users that had different permissions on
their tmp-folder in their home, like root as owner from a previous
sudo-command.

The new implementation uses os.tmpdir()

This fixes: npm/npm#3470
bb08d81
@robertkowalski robertkowalski added a commit to robertkowalski/osenv that referenced this issue May 26, 2014
@robertkowalski robertkowalski Use os.tmpDir() for temp-dirs
The former implementation preferred /home/{username}/tmp on unix
which caused errors for users that had different permissions on
their tmp-folder in their home, like root as owner from a previous
sudo-command.

The new implementation uses os.tmpDir() to be node 0.8 compatible

This fixes: npm/npm#3470
d6eddbc
@robertkowalski robertkowalski self-assigned this May 26, 2014
@robertkowalski robertkowalski added a commit to robertkowalski/npm that referenced this issue Jun 8, 2014
@robertkowalski robertkowalski Update osenv@0.1.0 which removes ~/tmp as possible tmp-folder
Closes #3470
48ac5e3
Member

Good news, the next release of npm should include the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment