Bugfix: How to fix 'scripts/nx is not recognized' on Windows GitHub ...

Documentation for Sessions

🐛 Bugfix: How to fix 'scripts/nx is not recognized' on Windows GitHub ...

Date: 2026-02-25
Time: 21:35:36 UTC
Session: gspace1-142.4
Agent: angular
Confidence: 97%
Status: ✅ Documented


📋 Decision Context

Question:

How to fix 'scripts/nx is not recognized' on Windows GitHub Actions when running Angular build?

Task: Fix Vitto Desktop CI/CD release workflow


🎯 Decision Made

Chosen:

Replace yarn nx build with node node_modules/nx/bin/nx.js build to call NX directly via Node, bypassing yarn's cmd.exe script resolution entirely.

Options Considered:

  1. node node_modules/nx/bin/nx.js (direct call — chosen)
  2. npx nx (same .cmd issue on Windows)
  3. ./scripts/nx directly in bash (bypasses yarn but fragile)
  4. yarn dlx nx (slow, downloads each time)

💭 Reasoning

On Windows, yarn nx resolves through yarn.cmd which executes in cmd.exe context. The package.json script maps nx to ./scripts/nx (a bash shim), which cmd.exe cannot execute. Even with shell: bash on the GitHub Actions step, yarn itself still uses cmd.exe internally. Calling node node_modules/nx/bin/nx.js directly bypasses yarn's script resolution and works cross-platform. Alternative of npx nx would hit the same .cmd resolution issue.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation