Skip to content

[Fix] Handle Windows command shims during package installation - #755

Merged
Power-Maverick merged 2 commits into
devfrom
copilot/bug-installation-failed-einval
Oct 25, 2026
Merged

Power-Maverick merged 2 commits into
devfrom
copilot/bug-installation-failed-einval

Conversation

Copilot AI commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Package installation on Windows can fail immediately with spawn EINVAL when npm/pnpm .cmd shims are launched directly. Route detection and installation through cross-spawn for Windows-compatible execution and argument escaping.

Type of change

  • New feature
  • Bug fix
  • Refactor (no functional change)
  • Documentation
  • Chore / maintenance (dependency update, build, config)
  • Test addition / improvement

Changes

  • Process execution — toolsManager.ts
    • Replace native spawn with cross-spawn; remove manual .cmd suffixes.
    • Preserve pnpm preference, npm fallback, installation flags, and proxy environment.
  • Dependencies — package.json, pnpm-lock.yaml
    • Declare the existing transitive cross-spawn dependency directly; add TypeScript declarations.
  • Regression coverage — toolsManagerInstallation.test.ts
    • Cover platform-specific command selection, fallback, argument boundaries, proxy settings, and installation failures.

Architecture checklist

Packages (types & validation)

  • Not applicable — no changes to packages/

If you did change a package:

  • @pptb/types (types): type definitions updated and version bumped in packages/types/package.json
  • @pptb/validate (validation): validation rules updated and version bumped in packages/validation/package.json

Code quality

  • pnpm run typecheck passes with 0 errors (warnings are acceptable)
  • pnpm run lint passes with 0 errors (warnings are acceptable)
  • pnpm run build completes successfully

Testing

  • pnpm run test:unit passes (for changes to src/main/, src/common/, or src/renderer/ utilities)
  • pnpm run test:e2e passes (for UI / navigation / end-to-end flows)
  • Manually tested in the running app (pnpm run dev)

Scenario tested:

Regression cases include scoped packages, paths containing spaces and shell metacharacters, unavailable package managers, and subprocess errors.

Screenshots / recordings

Not applicable; no UI changes.

Breaking changes

  • No breaking changes
  • Yes — describe impact and migration path below:

Reviewer notes

Native Windows verification remains outstanding; platform behavior is covered through mocked subprocess tests.

  • I have added appropriate unit and/or e2e tests for this change
  • I have resolved all GitHub Copilot review comments
  • I have followed the guidelines in CONTRIBUTING.md

Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix installation error with spawn EINVAL on Windows [Fix] Handle Windows command shims during package installation Oct 25, 2026
Copilot AI requested a review from Power-Maverick October 25, 2026 03:13
@Power-Maverick
Power-Maverick marked this pull request as ready for review October 25, 2026 14:48
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

✅ PR Checklist

All required checklist items are complete. This PR is ready for review.

@PowerPlatformToolBox PowerPlatformToolBox deleted a comment from github-actions Bot Oct 25, 2026
@github-actions

Copy link
Copy Markdown

Bundle Size Report 📦

Bundle Size
Main Process 2.7 MB
Renderer JS 1.23 MB
Renderer CSS 126.6 KB
Total 4.05 MB

Bundle Analysis Reports

The detailed bundle analysis reports are available in the workflow artifacts:

  • 📊 Main Process: stats-main.html
  • 📊 Renderer Process: stats-renderer.html

Download the artifacts from the workflow run to view interactive visualizations.


Bundle size tracking is now active! This helps prevent bundle bloat.

@Power-Maverick
Power-Maverick merged commit 9f50ad7 into dev Oct 25, 2026
13 of 24 checks passed
@Power-Maverick
Power-Maverick deleted the copilot/bug-installation-failed-einval branch October 25, 2026 14:49
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.

[Bug]: Installation Failed with Error: spawn EINVAL on Windows (v1.2.7)

2 participants