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 buildwithnode node_modules/nx/bin/nx.js buildto call NX directly via Node, bypassing yarn's cmd.exe script resolution entirely.
Options Considered:
- node node_modules/nx/bin/nx.js (direct call — chosen)
- npx nx (same .cmd issue on Windows)
- ./scripts/nx directly in bash (bypasses yarn but fragile)
- 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
.github/workflows/release-vitto-desktop.yml
🔗 Related
- Decision ID:
dev_1772055336437_mobp9gg - Session: 142
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation