diff --git a/lib/utils/cloud.ts b/lib/utils/cloud.ts index 8515af2429..590852c87a 100644 --- a/lib/utils/cloud.ts +++ b/lib/utils/cloud.ts @@ -185,8 +185,8 @@ export async function downloadOSImage( output = fs.createWriteStream(outputPath); } - const streamToPromise = await import('stream-to-promise'); - await streamToPromise(stream.pipe(output)); + const { pipeline } = await import('node:stream/promises'); + await pipeline(stream, output); console.info( `balenaOS image version ${displayVersion} downloaded successfully`,