-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors - silently fails upon extracting #98
Comments
Sorry that you wasted 3 hours of your life. This is an open source project where anyone can contribute fixes and solutions to make it better. If you wanted to be constructive you could have included detail of what you had problems with and suggestions for fixes. It might be related to #92 which will land soon. |
Okay excuse me for my tone - it was wrong! Anyway I think if it's known issue it should be stated in README that this might cause problems while extracting full zip. const zipper = fs.createReadStream(filePath).pipe(unzipper.Extract({ path: path.resolve(path.dirname(require.main.filename), 'dist') }));
zipper.on('close', () => {
console.log('done');
});
zipper.on('error', (error) => {
console.log(error);
});
|
Thank you for this report. I just extracted a bunch of zip files and was unable to recreate this issue (i.e. the Please note that the fix to #92 was released yesterday and the most current version of To help me debug your particular situation, please upload a failing zip file (or send to me at [email protected]) and/or give me more information about your setup, i.e. OS, node version and unzipper version. |
@gooor - following up on ^^^ |
@ZJONSSON original file itself was not corrupted. Only one that was downloaded from url and extracted after that. https.get(url, (response) => {
response.pipe(file);
file.on('finish', () => {
file.close();
const zipper = fs.createReadStream(filePath).pipe(unzipper.Extract({ path: '.\\' }));
zipper.on('close', () => {
console.log(`ZIP deployed`);
});
zipper.on('error', (error) => {
console.error(`Erroe while uploading`, error);
});
});
}).on('error', () => {
fs.unlink(filePath, () => {});
}); For some reason sometimes file that was sent was "incomplete" (size was smaller than original one). No |
Thanks @gooor. Obviously I can only be helpful if you share the full detail (sample file, your os etc). Please note that in your example you do not explicitly need to write the file to fs unless you need to retain the zip file. You should be able to: http.get(url, async response => async new Promise( (resolve, reject) => {
response.pipe(unzipper.Extract({path}))
.on('close', resolve)
.on('error', reject);
})); and furthermore, if you are only interested in particular files inside the zip (not all of them), you can download/unzip only the files of interest from inside the zipfile (not the other files) directly (see README and also webunzipper (a cli tool based on unzipper). Here is an example of fetching smaller files out of 500mb within a zip file that exists only remotely: Nevertheless, if you ware having issues with extract it's important to get to the bottom of this, so I appreciate you help |
@ZJONSSON ok found a steps to reproduce. I tested this only on OSX. Create any ZIP file with any contents (put more than one file to see results). Use ie.
const zipper = fs.createReadStream(filePath).pipe(unzipper.Extract({ path: __dirname }));
zipper.on('close', () => {
console.log(`ZIP deployed`);
});
zipper.on('error', (error) => {
console.error(`Erroe while extracting`, error);
}); When unzipping correct file console states: |
Thanks @goor that is very helpful. Will take a look! |
I am also experiencing this problem. I am missing several files using unzipper. However, if I unzip the zip file manually, all the files are in there. |
I'm experiencing a similar problem. In case of the mixed slashes in my destination path, (e.g. on win "C:\temp/anotherDir") the extract method silently fails. A simple path.normalize over the path makes extract succeed. |
Thanks @mmajcica, can you submit a PR? |
@ZJONSSON Hi! I have the same error when use it with node ftp client.
But sometimes process freeze and nothing happend (see picture). path.normalizer don't help with it. I try to catch errors with |
I am still facing this issue. Some files and folders went missing upon extraction on web hosting platform (00webhost). Has anyone found a work around? Edit : This is a free webhosting site .My extraction was failing due to quota limit exceed. |
Experiencing the same. Any fix found for this? |
It doesn't throw errors, works unexpectedly, better to just install zip and do child_process. Come on, I just wasted 3 hours of my life trying to use it and it's complete mess
The text was updated successfully, but these errors were encountered: