isaacs/node-tar — Issue #3: Can't install on eCryptfs
Author: rvagg
Created: 2012-01-13 11:41:43+00:00
State: open

This is an odd one, I'll grant that; but you can't install node-tar or even clone this repository on an eCryptfs subdirectory, which is used on Ubuntu (et. al.) for encrypted home directories.

```
$ git clone https://github.com/isaacs/node-tar.git
Cloning into node-tar...
remote: Counting objects: 649, done.
remote: Compressing objects: 100% (231/231), done.
remote: Total 649 (delta 370), reused 647 (delta 368)
Receiving objects: 100% (649/649), 153.89 KiB | 68 KiB/s, done.
Resolving deltas: 100% (370/370), done.
error: unable to create file test/fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc (File name too long)
```

```
$ npm install tar
npm http GET https://registry.npmjs.org/tar
npm http 304 https://registry.npmjs.org/tar
npm http GET https://registry.npmjs.org/tar/-/tar-0.1.11.tgz
npm http 200 https://registry.npmjs.org/tar/-/tar-0.1.11.tgz

npm ERR! Error: UNKNOWN, unknown error '/home/rvagg/.npm/tar/0.1.11/___package.npm/package/test/fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'
npm ERR! You may report this log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Linux 3.0.0-14-generic
npm ERR! command "node" "/usr/local/bin/npm" "install" "tar"
npm ERR! cwd /home/rvagg/git
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.0
npm ERR! path /home/rvagg/.npm/tar/0.1.11/___package.npm/package/test/fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
npm ERR! code UNKNOWN
npm ERR! message UNKNOWN, unknown error '/home/rvagg/.npm/tar/0.1.11/___package.npm/package/test/fixtures/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/rvagg/git/npm-debug.log
npm not ok
```

I only discovered this because of a failing `npm update npm -g`, the "UNKNOWN, unknown" isn't very helpful and took a bit of digging to figure out.

The issue is that eCryptfs can't handle filenames over 144 characters (at least ontop of ext4 which has a limit of 255. I think it may be different if the underlying fs has a different filename length limit). The workaround for me was to install as *root* who's home directory isn't set up as eCryptfs on Ubuntu (even using `sudo` your HOME is preserved so it still uses ~/.npm).

Does this particular filename need to be that long? GitHub even has random problems with the file when navigating to it: https://github.com/isaacs/node-tar/tree/master/test/fixtures