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.

can't find end of central directory

See original GitHub issue

I upload one file which had about ten thousand lines of text, but it throw error. The error is “can’t find end of central directory”.

ERROR 24471 nodejs.Error: Corrupted zip : can't find end of central directory (uncaughtException throw 1 times on pid:24471)
    at ZipEntries.readEndOfCentral (/home/servers/api.cloud.nh/node_modules/_xlsx@0.11.19@xlsx/jszip.js:2270:19)
    at ZipEntries.load (/home/servers/api.cloud.nh/node_modules/_xlsx@0.11.19@xlsx/jszip.js:2332:14)
    at new ZipEntries (/home/servers/api.cloud.nh/node_modules/_xlsx@0.11.19@xlsx/jszip.js:2156:14)
    at JSZip.module.exports [as load] (/home/servers/api.cloud.nh/node_modules/_xlsx@0.11.19@xlsx/jszip.js:577:18)
    at new JSZip (/home/servers/api.cloud.nh/node_modules/_xlsx@0.11.19@xlsx/jszip.js:524:14)
    at read_zip (/home/servers/api.cloud.nh/node_modules/_xlsx@0.11.19@xlsx/xlsx.js:18863:24)
    at Object.readSync [as read] (/home/servers/api.cloud.nh/node_modules/_xlsx@0.11.19@xlsx/xlsx.js:18931:69)
    at FileStream.stream.once (/home/servers/api.cloud.nh/app/extend/application.js:200:22)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at FileStream.emit (events.js:208:7)
    at emitReadable_ (_stream_readable.js:513:10)
    at _combinedTickCallback (internal/process/next_tick.js:135:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
superlbrcommented, Apr 27, 2018

yeah, the file is ok. But little change in saving from request’s file stream. Look out when fs.createWriteStream deal with xlsx file Other people see this, please read https://github.com/SheetJS/js-xlsx#streaming-read

0reactions
idubicommented, Nov 8, 2021

workbook.xlsx.readFile … will try to load xlsx file

that is a compressed excel file so it will fail with this message :

_stack:'Error: Can't find end of central directory_

only try to use it on compressed excel file

if you want to load a csv file you need to use : _workbook.csv.readFile_ if you want a regular excel (uncompressed) then : _workbook.excel.readFile_

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Corrupted zip : can't find end of central directory - XLSX
In my case I was working on .xls file. Opened the file and stored it as Excel Workbook (.xlsx). This solved my problem....
Read more >
Error: Corrupted zip : can't find end of central directory #35
However, when I try to parse the data, I get the following error. Error: Corrupted zip : can't find end of central directory...
Read more >
How to Fix End of Central Directory Signature Not Found
Method 2: Download the File Again​​ As it turns out, the “end of central directory signature not found” is usually experienced when the ......
Read more >
Can't find end of central directory : is this a zip file - GitLab
But, it keeps throwing this error "Can't find end of central directory : is this a zip file". Bye the way it reads...
Read more >
unzip error "End-of-central-directory signature not found"
Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory...
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