[BUG] Claude Code: Cannot run Electron apps on Windows - bash/electron compatibility issue
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I encountered an issue using Claude Code on Windows where it cannot successfully run Electron applications via the Bash tool.
Environment:
Platform: Windows 10/11
Claude Code version: (current)
Node.js: v18.18.2
Electron: v28.3.3
Issue:
When Claude Code attempts to run an Electron app using npm start or npx electron . through the Bash tool, the require('electron') call returns a string (the path to the electron binary) instead of the electron module object. This causes the app to crash with:
TypeError: Cannot read properties of undefined (reading 'disableHardwareAcceleration')
The same commands work correctly when run directly from Windows Command Prompt or PowerShell.
Workaround:
Running npm start directly from a native Windows terminal works correctly.
Suggestion:
Consider documenting this limitation or investigating whether the bash environment can be configured to properly invoke Windows electron binaries.
What Should Happen?
Expected behavior:
Claude Code should be able to start Electron applications on Windows, or clearly indicate this is a known limitation.
Error Messages/Logs
TypeError: Cannot read properties of undefined (reading 'disableHardwareAcceleration')
The same commands work correctly when run directly from Windows Command Prompt or PowerShell.
Steps to Reproduce
I encountered an issue using Claude Code on Windows where it cannot successfully run Electron applications via the Bash tool.
Environment:
Platform: Windows 10/11
Claude Code version: (current)
Node.js: v18.18.2
Electron: v28.3.3
Issue:
When Claude Code attempts to run an Electron app using npm start or npx electron . through the Bash tool, the require('electron') call returns a string (the path to the electron binary) instead of the electron module object. This causes the app to crash with:
TypeError: Cannot read properties of undefined (reading 'disableHardwareAcceleration')
The same commands work correctly when run directly from Windows Command Prompt or PowerShell.
Workaround:
Running npm start directly from a native Windows terminal works correctly.
Suggestion:
Consider documenting this limitation or investigating whether the bash environment can be configured to properly invoke Windows electron binaries.
claude --version doesn't work on my machine.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.11
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗