question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unzip stops prematurely in Node 0.10.0

See original GitHub issue

Unzip stops prematurely in Node 0.10.0 without an error when inflating compressed files that are larger than the zlib stream’s highWaterMark (16 kb). I believe the issue is the line self._untilStream.pipe(vars.compressedSize, inflater).pipe(entry) - the inflater stream never emits ‘end’ or ‘finish’.

Code:

if (fileSizeKnown) {
  entry.size = vars.uncompressedSize;
  self._untilStream.pipe(vars.compressedSize, inflater).pipe(entry);
}

The error surfaced while I was investigating #19.

Issue Analytics

  • State:open
  • Created 11 years ago
  • Comments:21 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
tomitrescakcommented, Oct 24, 2017

Hi, I installed from npm, used as:

fs
            .createReadStream(req.file.path)
            .pipe(
              unzip.Extract({
                path: webBuildFolder
              }).on('close', function() {
                console.log('NOW!');
              })
            )

And getting error with Mac packed archives:

invalid signature: 0xa
0reactions
ashelleycommented, Feb 13, 2015

Hello I was having an issue with close not being called when these errors were happening for parser.on(‘error’):

entry:

Error: invalid signature: 0xa
    at /var/www/test/unzip-test/node_modules/unzip/lib/parse.js:59:13
    at processImmediate [as _immediateCallback] (timers.js:345:15)

entry:

Error: invalid code lengths set
    at Zlib._binding.onerror (zlib.js:295:17)

I ended up googling around and found this issue:

https://github.com/EvanOxfeld/node-unzip/issues/47

So i tried cloning this repo:

https://github.com/AnkurMali/node-unzip

And this fixed my problem,. The errors completely went away and I was able to extract the file (no error) and the close method was being called.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best methods for unzipping files in Node.js - LogRocket Blog
Learn the best methods for zipping and unzipping files in Node.js using the decompress, adm-zip, zlib, unzipper, and jszip packages.
Read more >
unzipper - npm
Unzipper provides simple APIs similar to node-tar for parsing and extracting zip files. There are no added compiled dependencies - inflation is ...
Read more >
Changelog - Cypress Documentation
This prevents Cypress from crashing when a user has Node 17 installed which was built with OpenSSL v1. Fixes #19320. Correctly cast the...
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
... Bug:235 - "shadow/KDEadmin package compile error, prevents install of KDE, ... with unzip 5.42" status:RESOLVED resolution:FIXED severity:normal ...
Read more >
Documentation - Apache Kafka
The broker.id property is the unique and permanent name of each node in the ... stop all old (0.10.0.x) application instances; update your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found