This document details the issues encountered and solutions implemented to run check-if-email-exists (v0.9.1) on Windows.
Issue: The GNU target (x86_64-pc-windows-gnu) was not available or failed to download for v0.9.1.
Fix: Use the MSVC target (x86_64-pc-windows-msvc) which is correctly published in the GitHub Releases.
Target: x86_64-pc-windows-msvc
Issue: GitHub Releases use HTTP 302 redirects to serve valid asset URLs (redirecting to objects.githubusercontent.com or similar). Standard https.get in Node.js does not follow redirects automatically.
Fix: Implement recursive redirect following in the download script. If a 301/302 status code is received with a Location header, the script must verify the new URL.
Issue:
- File Locking: Attempting to extract the binary before the file write stream was fully closed caused errors ("resource busy or locked").
- Tar Path Interpretation: On Windows, passing absolute paths with drive letters (e.g.,
C:\...) totarcan cause it to interpret the colon as a remote host specifier (e.g.,host:path), failing with "Cannot connect to C: resolve failed".
Fix:
- Wait for Close: Ensure
file.close(cb)is called and the callback fires before attempting extraction. - Relative Paths: Change the working directory (
cd) to the target folder and use relative filenames for the archive, avoiding absolute paths with drive letters in thetarcommand.
// Example of correct tar usage on Windows
const cmd = `cd "${BIN_DIR}" && tar -xf "temp.tar.gz"`;
await execAsync(cmd);