adm-zip: Invalid or unsupported zip format. No END header found
Error:
Jerrys-MacBook-Pro:client jerrygreen$ node zip.js
/Users/jerrygreen/my_project/node_modules/adm-zip/zipFile.js:66
throw Utils.Errors.INVALID_FORMAT;
^
Invalid or unsupported zip format. No END header found
My (simple) code:
const AdmZip = require('adm-zip')
const zip = new AdmZip('./my_file.zip')
I’m using Macos 10.14.1
By opening it from Finder (using default Archive Utility app) it’s unzipping nicely, no problems
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 24
- Comments: 20
I made a workaround for this as I was getting the zip file externally and then saved locally to extract.
A setTimeout solved my issue.
Anyone still experiencing the issue? Would appreciate a solution that is not dependent on
dittoif possible.The terminal output is:
I had the same problem and it turned out to be an issue with how I download the file. I never waited for the download to complete before attempting to unzip it.
Solution: Properly await the download and only then start working with the ZIP file.
This happened to me once, but when retrying (same code, same file) it works. Weird.