From 9a2191b79af4bf9ecbc978a7e805bdf32da81e4c Mon Sep 17 00:00:00 2001 From: Franz-Eric Sill <107982913+qwerdenkerXD@users.noreply.github.com> Date: Mon, 13 Jul 2026 09:46:12 +0200 Subject: [PATCH] Fixes race in scripts/install-binary.mjs In WSL on mounted paths like /mnt/c/... it happened that the file stream of the downloaded jq binary wasn't closed before chmod was called, leading to: npm error Error: ENOENT: no such file or directory, chmod '/mnt/c/.../node_modules/node-jq/bin/jq' --- scripts/install-binary.mjs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/install-binary.mjs b/scripts/install-binary.mjs index 0c836768..28f5aa59 100644 --- a/scripts/install-binary.mjs +++ b/scripts/install-binary.mjs @@ -180,13 +180,11 @@ async function downloadFile(url, dest) { dataStream.on('end', () => { console.log('\nDownload complete') - fileStream.end() - resolve() + fileStream.end(() => resolve()) }) dataStream.on('error', (err) => { - fileStream.end() - reject(err) + fileStream.end(() => reject(err)) }) }) }