-
Notifications
You must be signed in to change notification settings - Fork 683
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
[BUG]: Cannot download electron #1156
Comments
Additions from @aryanshridhar :
|
I used the following code for the simulation but could not reproduce it. const fs = require("fs");
const got = require("got");
const url = "https://npmmirror.com/mirrors/electron/v19.0.6/SHASUMS256.txt";
const gotOptions = {
timeout: {
connect: 15000,
lookup: 15000,
response: 15000,
socket: 15000,
},
}
const targetFilePath = "/Users/black-hole/1/SHASUMS256.txt";
const writeStream = fs.createWriteStream(targetFilePath);
const downloadStream = got.stream(url, gotOptions)
downloadStream.on('downloadProgress', async (progress) => {
console.log(progress);
});
downloadStream.on('error', error => {
if (writeStream.destroy) {
writeStream.destroy(error);
}
console.error("download error", error);
});
writeStream.on('error', error => {
console.log("file error", error);
});
writeStream.on('close', () => {
console.log("close")
});
downloadStream.on("data", data => {
console.log(data.toString());
})
downloadStream.pipe(writeStream); Even if I put the code in devtools and execute it, it works fine. |
I know what the content represents now. This is |
This was a bug in See: sindresorhus/got#1105 / sindresorhus/got#945 This bug is only triggered in the This also explains why the code I wrote to reproduce the problem was not reproducible
|
During the download, I found that
SHASUMS256.txt
was a bunch of useless strings, causing the checksum to fail.1.mp4
I have confirmed through
git bisect start HEAD 3aa1e64
that the problem is caused by #1109 PR. But it is not clear why this is the case.CC: @erickzhao @dsanders11 @aryanshridhar
The text was updated successfully, but these errors were encountered: