diff --git a/editors/code/src/installation/download_file.ts b/editors/code/src/installation/download_file.ts index b51602ef9f..fe356c39d6 100644 --- a/editors/code/src/installation/download_file.ts +++ b/editors/code/src/installation/download_file.ts @@ -27,8 +27,7 @@ export async function downloadFile( readBytes += chunk.length; onProgress(readBytes, totalBytes); }) - .on("end", resolve) .on("error", reject) - .pipe(fs.createWriteStream(destFilePath)) + .pipe(fs.createWriteStream(destFilePath).on("close", resolve)) ); }