-
Notifications
You must be signed in to change notification settings - Fork 117
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
Corrupted unzipped files when using Extract #286
Comments
hello , I have got the same issue, when I extract a zip on linux debian , I have got the javascript files inside my zip that have been modified. |
+1 |
Same issue on Windows 11 Is related to #271 |
same issue when run from macos... |
same problem here. in a linux docker image in openshift ... |
I ran into this issue. After much research, this appears to be an issue brought on by changes in NodeJS. I was using 18.18.0 when I ran into the issue. Downgrading to v18.15.0 solved the problem. The issue exists in v18.16.0 and above. |
Wow @PeterSelvaraj you nailed it, well done and thanks for the hard work! I can confirm this is the case in I'm installing % unzip chromedriver_mac_arm64.zip
Archive: chromedriver_mac_arm64.zip
inflating: chromedriver
inflating: LICENSE.chromedriver
% md5 chromedriver
MD5 (chromedriver) = 5e4ba0b62a072ff281fe9fc769d8665a Then run: import { createReadStream, readFileSync } from "node:fs";
import { Extract } from "unzipper";
import { createHash } from "node:crypto";
// version
console.log("Node.js version:", process.versions.node);
// unzipper
await createReadStream("chromedriver_mac_arm64.zip")
.pipe(Extract({ path: "." }))
.promise();
// MD5
const buffer = readFileSync("chromedriver");
const md5 = createHash("md5");
md5.write(buffer);
console.log("MD5:", md5.digest().toString("hex")); Then playing with the .tool-versions =>
|
I came upon this issue after having done quite a bit of investigation myself on some problems we were having in our app. I found that this is the exact commit in NodeJS that broke it: nodejs/node@654b747 I essentially built NodeJS from source and did a checkout of commits to see when stuff breaks and when it doesn't |
Hit the same issue upgrading to Node v20. Replaced unzipper with
|
Does anyone know if there is any fix on the way? Downgrading to node 18.15. is not an option because the latest supported electron version comes with 18.16. so basically |
This does look like a bug in nodejs, which can cause the Thanks @Fadorico for finding the change. Unfortunately the |
I was facing the same issue of corrupted files when the zip is extracted! try {
} catch (error) { |
You can read my comment I have mentioned some other package which is working fine with latest node version |
Thanks to @dy-dx for following up on the node issue. Although not directly related to this bug (since it's createWriteStream related) we have moved from unmaintained published as |
I'm trying to unzip a
.zip
file containing chromedriver using unzipper@0.10.14. When attempting to unzipchromedriver_linux64.zip
downloaded from here, the extraction succeeds, but the executable is corrupted:Then, when I run:
$ md5sum /tmp/chromedriver 641c5ede222e09e76fe52bc1bc61c0a9 $ /tmp/chromedriver zsh: permission denied: /tmp/chromedriver $ chmod +x /tmp/chromedriver $ /tmp/chromedriver zsh: exec format error: /tmp/chromedriver
Since I wasn't sure if I was using the
.promise()
method correctly, I also tried using the equivalent of the README example, but got the same results:However, this works just fine with extract-zip@2.0.1:
Then, when I run:
The text was updated successfully, but these errors were encountered: