isaacs/npm — Issue #2089: Error in "npm install -g findit"
Author: elentok
Created: 2012-01-24 21:09:37+00:00
State: open

When running "npm install findit" (locally) it works fine,
but when running "sudo npm install -g findit" this happens:

```shell
npm http GET https://registry.npmjs.org/findit
npm http 304 https://registry.npmjs.org/findit

npm ERR! Error: UNKNOWN, unknown error '/usr/lib/node_modules'
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/bin/npm" "install" "-g" "findit"
npm ERR! cwd /home/david/projects/npm-stuff/test
npm ERR! node -v v0.6.8
npm ERR! npm -v 1.1.0-2
npm ERR! path /usr/lib/node_modules
npm ERR! fstream_path /usr/lib/node_modules/___findit.npm
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code UNKNOWN
npm ERR! message UNKNOWN, unknown error '/usr/lib/node_modules'
npm ERR! errno {}
npm ERR! fstream_stack Object.oncomplete (/usr/lib/nodejs/npm/node_modules/fstream/lib/writer.js:161:23)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/david/projects/npm-stuff/test/npm-debug.log
npm not ok
```

The contents of the "npm-debug.log" file:

```shell

info it worked if it ends with ok
verbose cli [ 'node', '/usr/bin/npm', 'install', '-g', 'findit' ]
info using npm@1.1.0-2
info using node@v0.6.8
verbose /usr/bin/node node symlink
verbose config file /home/david/.npmrc
verbose config file /usr/etc/npmrc
verbose config file /usr/lib/nodejs/npm/npmrc
verbose cache add [ 'findit', null ]
silly cache add: name, spec, args [ undefined, 'findit', [ 'findit', null ] ]
verbose parsed url { pathname: 'findit', path: 'findit', href: 'findit' }
verbose addNamed [ 'findit', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'findit', '', false ]
verbose raw, before any munging findit
verbose url resolving [ 'https://registry.npmjs.org/', './findit' ]
verbose url resolved https://registry.npmjs.org/findit
verbose etag "T02A52HVO97IV90FEIGJRP14"
http GET https://registry.npmjs.org/findit
http 304 https://registry.npmjs.org/findit
silly get cb [ 304,
silly get cb { server: 'CouchDB/1.1.0 (Erlang OTP/R14B04)',
silly get cb etag: '"T02A52HVO97IV90FEIGJRP14"',
silly get cb date: 'Tue, 24 Jan 2012 21:03:32 GMT',
silly get cb 'content-length': '0' } ]
verbose etag findit from cache
silly name, range, hasData 2 [ 'findit', '', true ]
silly versions [ 'findit',
silly versions [ '0.0.1',
silly versions '0.0.2',
silly versions '0.0.3',
silly versions '0.0.4',
silly versions '0.0.5',
silly versions '0.1.0',
silly versions '0.1.1',
silly versions '0.1.2' ] ]
verbose bin dist [ '0.6-ares1.7.5-DEV-evundefined-openssl1.0.0e-v83.6.6.19-linux-x64-3.0.0-14-generic',
verbose bin dist { shasum: 'ac7fe600cd6a32a35672836b74cf6f1dde2e11f8',
verbose bin dist tarball: 'http://registry.npmjs.org/findit/-/findit-0.1.2.tgz' } ]
verbose caching /home/david/.npm/findit/0.1.2/package/package.json
verbose loadDefaults findit@0.1.2
silly resolved [ { name: 'findit',
silly resolved version: '0.1.2',
silly resolved description: 'Walk a directory tree.',
silly resolved main: './index.js',
silly resolved dependencies: { seq: '>=0.1.7' },
silly resolved devDependencies: { hashish: '>=0.0.2 <0.1', expresso: '0.7.x' },
silly resolved scripts: { test: 'expresso' },
silly resolved repository:
silly resolved { type: 'git',
silly resolved url: 'git://github.com/substack/node-findit.git' },
silly resolved keywords: [ 'find', 'walk', 'directory', 'recursive', 'tree' ],
silly resolved author:
silly resolved { name: 'James Halliday',
silly resolved email: 'mail@substack.net',
silly resolved url: 'http://substack.net' },
silly resolved license: 'MIT/X11',
silly resolved engine: [ 'node >=0.2.0' ],
silly resolved _id: 'findit@0.1.2',
silly resolved optionalDependencies: {},
silly resolved engines: { node: '*' },
silly resolved _engineSupported: true,
silly resolved _npmVersion: '1.1.0-2',
silly resolved _nodeVersion: 'v0.6.8',
silly resolved _defaultsLoaded: true } ]
info into /usr/lib findit@0.1.2
info installOne findit@0.1.2
info unbuild /usr/lib/node_modules/findit
verbose from cache /home/david/.npm/findit/0.1.2/package/package.json
verbose unpack_ uid, gid [ undefined, undefined ]
verbose unpackTarget /usr/lib/node_modules/findit
silly gunzTarPerm modes [ '755', '644' ]
ERR! Error: UNKNOWN, unknown error '/usr/lib/node_modules'
ERR! You may report this log at:
ERR!
ERR! or email it to:
ERR!
ERR!
ERR! System Linux 3.0.0-14-generic
ERR! command "node" "/usr/bin/npm" "install" "-g" "findit"
ERR! cwd /home/david/projects/npm-stuff/test
ERR! node -v v0.6.8
ERR! npm -v 1.1.0-2
ERR! path /usr/lib/node_modules
ERR! fstream_path /usr/lib/node_modules/___findit.npm
ERR! fstream_type Directory
ERR! fstream_class DirWriter
ERR! code UNKNOWN
ERR! message UNKNOWN, unknown error '/usr/lib/node_modules'
ERR! errno {}
ERR! fstream_stack Object.oncomplete (/usr/lib/nodejs/npm/node_modules/fstream/lib/writer.js:161:23)
verbose exit [ 1, true ]
```

I'm using Ubuntu 11.10 and I installed nodejs like this:

```shell
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs nodejs-dev npm
```