julien-c / epub

node.js epub reader
https://www.npmjs.com/package/epub
Other
333 stars 307 forks source link

zipfile break on node >= 6.4 #25

Open gimox opened 7 years ago

gimox commented 7 years ago

On nodejs >= 6.4 zipfile lib break install.

For a working version i removed zipfile as dependance!!

nbrustein commented 6 years ago

I'm seeing issues with zipfile on node v6.11.5. Some files get unzipped successfully. Others fail. This is a link to one file that is not working: https://www.buecher.de/shop/schauspieler/der-junge-muss-an-die-frische-luft/kerkeling-hape/products_products/detail/prod_id/44880761/ (It is not free. I can send you a copy of it privately if you need it)

I was able to hack around the problem by doing the following before requiring epub:


    var zipfile = require('zipfile');
    Object.defineProperty(zipfile, 'ZipFile', {
        get: function() {
            throw new Error('Disable ZipFile.');
        }
    });

That causes zipfile to blow up when epub tries to load it, forcing epub to fall back to the js-only implementation.