isaacs/npm — Issue #1833: Issues with npm in lion osx, xcode 4.2
Author: gazetaj
Created: 2011-12-04 13:40:36+00:00
State: open

when executing these steps with or without sudo, I get the following errors:
command: sudo curl http://npmjs.org/install.sh | sh

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7184 100 7184 0 0 5711 0 0:00:01 0:00:01 --:--:-- 68419
tar=/sw/bin/tar
version:
tar (GNU tar) 1.16.1
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License .
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
fetching: http://registry.npmjs.org/npm/-/npm-1.0.106.tgz

gzip: stdin: decompression OK, trailing garbage ignored
/sw/bin/tar: Child returned status 2
/sw/bin/tar: Error exit delayed from previous errors
It failed

So I decided to use the git, make install process which worked. After which I try to install express.
Command: npm install -g express
I have also tried: npm install -g express@2.5.1

In both cases here is the result:

npm ERR! Failed unpacking /tmp/npm-1323004216978/1323004216978-0.5320614376105368/tmp.tgz
npm ERR! couldn't unpack /tmp/npm-1323004216978/1323004216978-0.5320614376105368/tmp.tgz to /tmp/npm-1323004216978/1323004216978-0.5320614376105368/contents
npm ERR! Error: `tar "-zmvxpf" "/tmp/npm-1323004216978/1323004216978-0.5320614376105368/tmp.tgz" "-o"`
npm ERR! failed with 2
npm ERR! at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/tar.js:217:20)
npm ERR! at ChildProcess.emit (events.js:70:17)
npm ERR! at maybeExit (child_process.js:359:16)
npm ERR! at Socket. (child_process.js:456:7)
npm ERR! at Socket.emit (events.js:67:17)
npm ERR! at Array.1 (net.js:302:10)
npm ERR! at EventEmitter._tickCallback (node.js:192:40)
npm ERR! Report this *entire* log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /private/tmp
npm ERR! node -v v0.6.4
npm ERR! npm -v 1.0.106
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /private/tmp/npm-debug.log
npm not ok

Seems it can't untar the downloaded files. I have found issue #1448 which seems to be very similar to the issue I am having. Unfortunately it does not solve my issue.

I have tried the command: echo "tar = $(which tar)" >> ~/.npmrc
Just to make sure that the tar I am using is the same point for both root or my user and they are.

Any further suggestions would be appreciated.