ZJONSSON / node-unzipper

node.js cross-platform unzip using streams
Other
424 stars 114 forks source link

unzipper failed. Emitted 'error' event on DuplexWrapper instance at #289

Closed qq253498229 closed 6 months ago

qq253498229 commented 6 months ago
nwbuild({
  version: '0.82.0',
  src: './temp',
  platform: 'win',
  arch: 'x64',
  cacheDir: './cache',
  outDir: './out',
  flavor: 'normal',
  logLevel: 'debug',
  downloadUrl: 'https://npmmirror.com/mirrors/nwjs',
}).then(() => fs.removeSync('./temp'));
yarn run v1.22.21
$ node build.mjs --platform=win64
node:events:492
      throw er; // Unhandled 'error' event
      ^

Error: FILE_ENDED
    at Parse.pull (D:\own\wang-comic-downloader\nwjs\node_modules\unzipper\lib\PullStream.js:83:28)
    at Parse.emit (node:events:514:28)
    at Parse.<anonymous> (D:\own\wang-comic-downloader\nwjs\node_modules\unzipper\lib\PullStream.js:20:10)
    at Parse.emit (node:events:526:35)
    at finish (node:internal/streams/writable:937:10)
    at node:internal/streams/writable:918:13
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on DuplexWrapper instance at:
    at Parse.<anonymous> (D:\own\wang-comic-downloader\nwjs\node_modules\duplexer2\index.js:45:12)
    at Parse.emit (node:events:514:28)
    at Parse.pull (D:\own\wang-comic-downloader\nwjs\node_modules\unzipper\lib\PullStream.js:83:14)
    at Parse.emit (node:events:514:28)
    [... lines matching original stack trace ...]
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
saikatmitra91 commented 1 month ago

am facing the same issue. what was the fix here ?

qq253498229 commented 1 month ago

@saikatmitra91

In my issue, I tested many libraries related to decompression and found that it seems to be due to a specific reason in the macOS operating system.

In the end, I gave up on decompressing macOS app files on other operating systems.

Below are the reference links I used during my testing. The most helpful one for me was nw-builder; I hope it will be helpful for you as well:

https://www.npmjs.com/package/nw-builder https://www.npmjs.com/package/decompress https://www.npmjs.com/package/unzipper https://www.npmjs.com/package/adm-zip https://www.npmjs.com/package/tar https://www.npmjs.com/package/extract-zip