Skip to content

Installing NPM 0.1.27-11 fails with errors on unpacking the tarball #203

Closed
jsjohnst opened this Issue Aug 29, 2010 · 3 comments

2 participants

@jsjohnst

Installing via .sh file:

$ curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
122 244 122 244 0 0 1119 0 --:--:-- --:--:-- --:--:-- 3050
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 565k 100 565k 0 0 257k 0 0:00:02 0:00:02 --:--:-- 643k
node cli.js cache clean
npm info it worked if it ends with ok
npm info version 0.1.27-9
npm ok
node cli.js rm npm
npm info it worked if it ends with ok
npm info version 0.1.27-9
npm info not installed npm
npm ok
node cli.js install npm
npm info it worked if it ends with ok
npm info version 0.1.27-9
npm info fetch http://registry.npmjs.org/npm/-/npm-0.1.27-11.tgz
npm ERR! Failed unpacking the tarball.
npm ERR! This is very rare. Perhaps the 'gzip' or 'tar' configs
npm ERR! are set improperly?
npm ERR!
npm ERR! Error installing npm@0.1.27-11
npm ERR! Error: Failed -9 "--decompress" "--stdout" "/usr/local/lib/node/.npm/.cache/npm/0.1.27-11/package.tgz"
npm ERR! exited with 127
npm ERR! at ChildProcess. (/Users/jstone/Source/git/node/npm-9902/lib/utils/exec.js:41:19)
npm ERR! at ChildProcess.emit (events:33:26)
npm ERR! at Stream. (child_process:131:12)
npm ERR! at Stream.emit (events:26:26)
npm ERR! at Array.0 (net:988:12)
npm ERR! at EventEmitter._tickCallback (node.js:55:24)
npm ERR! at node.js:772:9
npm ERR! try running: 'npm help install'
npm ERR! Report this entire log at http://github.com/isaacs/npm/issues
npm ERR! or email it to npm-@googlegroups.com
npm not ok
make: *** [install] Error 1

Trying it via a fresh checkout from earlier today:

$ make
node cli.js install npm
npm info it worked if it ends with ok
npm info version 0.1.27-9
npm info fetch http://registry.npmjs.org/npm/-/npm-0.1.27-11.tgz
npm ERR! Failed unpacking the tarball.
npm ERR! This is very rare. Perhaps the 'gzip' or 'tar' configs
npm ERR! are set improperly?
npm ERR!
npm ERR! Error installing npm@0.1.27-11
npm ERR! Error: Failed -9 "--decompress" "--stdout" "/usr/local/lib/node/.npm/.cache/npm/0.1.27-11/package.tgz"
npm ERR! exited with 127
npm ERR! at ChildProcess. (/Users/jstone/Source/git/npm/lib/utils/exec.js:41:19)
npm ERR! at ChildProcess.emit (events:33:26)
npm ERR! at Stream. (child_process:131:12)
npm ERR! at Stream.emit (events:26:26)
npm ERR! at Array.0 (net:988:12)
npm ERR! at EventEmitter._tickCallback (node.js:55:24)
npm ERR! at node.js:772:9
npm ERR! try running: 'npm help install'
npm ERR! Report this entire log at http://github.com/isaacs/npm/issues
npm ERR! or email it to npm-@googlegroups.com
npm not ok
make: *** [install] Error 1

Installing this on a new machine with Node v0.2.0 for the first time.

@jsjohnst

Ok, finally tracked this one down. The issue is the default config for gzip pulls in process.env.GZIP as it's value. My default environment has this:

export GZIP="-9"

I've experimented with multiple values in the environment thinking maybe my format was non-standard and it seems no matter what value is in the export it causes npm to fail. The ones I've tested are:

GZIP="-9"
GZIP="gzip -9"
GZIP="gzip"
GZIP=""

Of which all fail until I unset the variable, then I was able to install npm fine.

Based on the man page for gzip:

ENVIRONMENT VARIABLES
GZIP
specifies the gzip options that are used by default whenever you invoke the utility. You can override these options with explicit options given on the command line. Here are some examples of how you can set this variable:

GZIP="-8v --name"; export GZIP

I'm lead to believe that the environment variable isn't meant to have what you expect it to have and as such these two lines inside default-config.js are in error:

, "tar" : process.env.TAR || "tar"
, "gzip" : process.env.GZIP || "gzip"

@isaacs
npm member
isaacs commented Aug 29, 2010

Ah, yeah, didnt' catch that. The GZIP env doesn't work like the TAR env.

I'll rename "gzip" to "gzipbin" || env.GZIPBIN

@isaacs
npm member
isaacs commented Aug 29, 2010

Fixed on 3cb1bc0

@isaacs isaacs added a commit to couchone/npm that referenced this issue Mar 30, 2012
@isaacs isaacs Fix #203. Use the env.GZIPBIN env instead of env.GZIP 3cb1bc0
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.