-
Notifications
You must be signed in to change notification settings - Fork 374
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
Error: RangeError [ERR_OUT_OF_RANGE] #426
Comments
I also saw this happen in one of my huge processes. The project I'm working on wants a massive zip of a bunch of their PDFs. By a bunch, I mean 15K+ PDFs with final pre-compression amount of 2.5GB+. It's a Civil Engineering firm and all these reports correspond to work done over the course of at least a year. Due to the size of the number, I have a feeling I've hit an overflow issue and will probably batch these reports up in groups of 5K for now. Regardless, I assume a more customized error should be thrown back |
I have the same problem. Here is a minimal example using // asdf.ts
import AdmZip from 'adm-zip';
const z = new AdmZip('myFile.zip');
z.extractAllTo('./temp', true); And here is the output:
I can unzip the file on my computer just fine, so I don't think it's corrupted. The zip file is about 280KB, so it shouldn't be a size issue either. |
For anyone else with this problem, my current workaround is to just not use this package 😢. I can achieve the desired result using this: import childProcess from 'child_process';
childProcess.execSync('unzip -d ./temp -o myFile.zip'); Would be nice to use adm-zip here, but for now I will have to just use |
Same issue as @dallenbaldwin with |
I eventually moved to a different package and refactored my code: |
Thanks @dallenbaldwin, I think I have to migrate my code too. |
After some investigation, I have figured out what went wrong for me. Hopefully this will help others. The issue in my case was that the "LastModifiedTime" and "CreatedTime" were the default 1979 timestamps. I used BulkFileChanger (https://www.nirsoft.net/utils/bulk_file_changer.html) to edit all my files to have a new time. This fixed it for me. |
Not my case. |
It seems to work now in 0.5.12 |
"adm-zip": "^0.5.9"
internal/buffer.js:72
throw new ERR_OUT_OF_RANGE(type || 'offset',
^
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 22. Received 23
at boundsError (internal/buffer.js:72:9)
at Buffer.readUInt16LE (internal/buffer.js:229:5)
at parseExtra (/Users/darmin/workspace/OnTheWay/jstest/test-zip/node_modules/adm-zip/zipEntry.js:158:25)
at Object.set extra [as extra] (/Users/darmin/workspace/OnTheWay/jstest/test-zip/node_modules/adm-zip/zipEntry.js:218:13)
at readEntries (/Users/darmin/workspace/OnTheWay/jstest/test-zip/node_modules/adm-zip/zipFile.js:55:29)
at Object.get entries [as entries] (/Users/darmin/workspace/OnTheWay/jstest/test-zip/node_modules/adm-zip/zipFile.js:123:17)
at Object.getEntries (/Users/darmin/workspace/OnTheWay/jstest/test-zip/node_modules/adm-zip/adm-zip.js:474:32)
at Object. (/Users/darmin/workspace/OnTheWay/jstest/test-zip/index.js:12:6)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
The text was updated successfully, but these errors were encountered: