Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 1.68 KB

File metadata and controls

28 lines (21 loc) · 1.68 KB

Windows Compatibility Fixes

This document details the issues encountered and solutions implemented to run check-if-email-exists (v0.9.1) on Windows.

1. Binary Selection

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

2. Download Redirects

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.

3. Extraction on Windows

Issue:

  1. File Locking: Attempting to extract the binary before the file write stream was fully closed caused errors ("resource busy or locked").
  2. Tar Path Interpretation: On Windows, passing absolute paths with drive letters (e.g., C:\...) to tar can cause it to interpret the colon as a remote host specifier (e.g., host:path), failing with "Cannot connect to C: resolve failed".

Fix:

  1. Wait for Close: Ensure file.close(cb) is called and the callback fires before attempting extraction.
  2. 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 the tar command.
// Example of correct tar usage on Windows
const cmd = `cd "${BIN_DIR}" && tar -xf "temp.tar.gz"`;
await execAsync(cmd);