Skip to content

Fix Windows npm installer extraction#148

Open
yashau wants to merge 1 commit into
dnakov:mainfrom
yashau:fix-npm-windows-install
Open

Fix Windows npm installer extraction#148
yashau wants to merge 1 commit into
dnakov:mainfrom
yashau:fix-npm-windows-install

Conversation

@yashau
Copy link
Copy Markdown

@yashau yashau commented May 19, 2026

Summary

  • Patch cargo-dist's generated npm package before publishing so the Windows installer prefers tar -xf for zip extraction.
  • Add a stricter PowerShell fallback with -ExecutionPolicy Bypass and $ErrorActionPreference = "Stop".
  • Verify expected binaries exist before the installer reports success.

Why

On Windows, the current npm package can print kittylitter has been installed! even when extraction failed and .bin_real/kittylitter.exe is missing. I hit this with npx kittylitter on Windows: Expand-Archive failed to autoload Microsoft.PowerShell.Archive, but powershell.exe exited 0, so the wrapper then failed with spawnSync ... .bin_real\kittylitter.exe ENOENT.

Verification

  • node --check tools/scripts/patch-kittylitter-npm-package.js
  • npx -y prettier@3.8.1 --check tools/scripts/patch-kittylitter-npm-package.js .github/workflows/release.yml
  • Patched the published kittylitter-0.3.2.tgz locally and confirmed the generated binary-install.js contains the Windows tar path and missing-binary guard.
  • Installed the patched tarball in a throwaway Windows npm project and confirmed node_modules/kittylitter/node_modules/.bin_real/kittylitter.exe exists and runs.
  • Confirmed the stricter PowerShell fallback extracts the release zip successfully on the same Windows machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant