Skip to content
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

Windows: compressed zip folder has invalid format #196

Closed
vitalets opened this issue Jul 6, 2016 · 6 comments
Closed

Windows: compressed zip folder has invalid format #196

vitalets opened this issue Jul 6, 2016 · 6 comments

Comments

@vitalets
Copy link

vitalets commented Jul 6, 2016

I'm creating zip on Mac osx and it is uncompressed correctly on mac finder.
But when I try to uncompress it on Windows 7 using standard "Extract all..." from right click menu of zip folder, I'm getting error:

compressed zip folder has invalid format

Using cmd unzip command works fine, using 7-zip also works fine.
What can be wrong?

@tmiller71
Copy link

Any luck with this? I'm having the same issue.

@vitalets
Copy link
Author

Currently not.
I\m doing it using cli now:

const fs = require('fs-extra');
const path = require('path');
// zip files created by this module are not extractable window default uncompress folder command
// see: https://github.com/archiverjs/node-archiver/issues/196
const archiver = require('archiver');
const exec = require('child_process').exec;

function createCli(dir, outFile) {
  return new Promise((resolve, reject) => {
    const relPath = path.relative(dir, outFile);
    exec(`zip -r ${relPath} .`, {cwd: dir}, error => error ? reject(error) : resolve());
  });
}

let's ping @ctalkington directly =)

@tmiller71
Copy link

All is good for me. It turns out the directory I was archiving had too many nested folders (thanks to Node). Once I excluded the node_modules directory the compressed file was valid.

@ctalkington
Copy link
Member

thanks for the ping, notifications on github never seem to work the way i want so I dont see alot of the initial reports.

as far as im aware this should be working fine, i don't have a CI that runs mac so its a bit harder to make tests to confirm such.

the paths being long could cause some issue for windows, i dont think built in explorer tool supports the extended paths feature of windows.

@dmytro-krekota
Copy link

+1
I also have same error on Windows 10.

@ctalkington
Copy link
Member

haven't personally been able to create this, if anyone encounters this still with v2.0.0 please open a new issue and provide as much detail and reproduction guidance as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants