question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid or unsupported zip format. No END header found

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:22
  • Comments:17

github_iconTop GitHub Comments

4reactions
krisrefscommented, Jan 13, 2022

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.

	const saveZIPFile = async () => {
		return new Promise((resolve) => {
			data.body.pipe(fs.createWriteStream(path.resolve(__dirname, `${project}.zip`)));

			data.body.on('end', () => {
				setTimeout(() => {
					resolve();
				}, 1000);
			});
		});
	};

	await saveZIPFile();

	var zip = new AdmZip(path.resolve(__dirname, `${project}.zip`));

	zip.extractAllTo(path), true);
4reactions
iget-mastercommented, Mar 18, 2021

This happened to me once, but when retrying (same code, same file) it works. Weird.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nodejs download and unzip file from url, error No END header ...
I am using nodejs webkit and adm-zip. I am getting error on console: Uncaught Invalid or unsupported zip format. No END header found....
Read more >
Invalid or unsupported zip format. No END header found
Hi ,. i am trying install appium in ubuntu 14.04 using npm install g appium and getting the below error. Invalid or unsupported...
Read more >
Invalid or unsupported zip format. No END header found
Hi, I have configured Visual Studio Code for salesforce. I am able to login but not able to retrieve "Source from Org" when...
Read more >
Getting "ZipError: zip END header not found" when reading S2 ...
This type of error indicates corrupted zip file. If something wrong happened during the download, retry to download until the zip extraction ...
Read more >
5 Methods to Fix Zip File Is Valid Problem
Part 1: What causes zip file invalid errors? · The virus is the greatest cause of zip file errors · MS office files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found