Git Product home page Git Product logo

Comments (4)

kirbysayshi avatar kirbysayshi commented on July 16, 2024 3

Hey @EvanOxfeld I just ran into this problem too. It may have something to do with long paths?

This zip https://dl.dropboxusercontent.com/u/52514/ghattachments/cannot-unzip.zip exhibits the problem. unzip -t says it's ok and unzip handles it just fine.

But...

fs.createReadStream(name)
  .pipe(unzip.Parse())
  .on('entry', function(entry) {
    console.log(entry.path);
    entry.autodrain();
  })

Produces

... lots of files ...
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/README.md
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/README.md
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/README.md
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/README.md
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/README.md
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js
node_modules/archiver/node_modules/file-utils/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: invalid code lengths set
    at Zlib._binding.onerror (zlib.js:295:17)

And

fs.createReadStream(name)
  .pipe(unzip.Parse())

Produces

Error: invalid signature: 0x642f7473
    at /Users/drewp/dev/test-proj/node_modules/unzip/lib/parse.js:63:13
    at process._tickCallback (node.js:415:13)

If I create a zip that doesn't contain the node_modules directory, node-unzip handles it just fine.

from node-unzip.

ashelley avatar ashelley commented on July 16, 2024

Hello,

I was getting the "invalid code lengths set" error and cloning this repo solved my issue on node v0.10.33

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

thanks @AnkurMali

from node-unzip.

ashelley avatar ashelley commented on July 16, 2024

Hello it seems that unzip2 already has this problem solved as well which means you don't need to maintain a fork of the repo to fix this issue:

https://github.com/glebdmitriew/node-unzip-2

from node-unzip.

AnkurMali avatar AnkurMali commented on July 16, 2024

Ya it seems unzip2 is working good for the issue. closing the request

from node-unzip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.