fix: Use npm.cmd on Windows for npm version check

Fixed npm detection on Windows by using npm.cmd instead of npm.
This resolves the 'npm is not installed or not in PATH' error on Windows systems.

Changes:
- Updated check_npm_installed() to use npm.cmd on Windows
- Uses self.is_windows flag to determine correct command
- Maintains cross-platform compatibility

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
donald
2025-12-06 00:02:35 +08:00
parent ef8a3a40be
commit ea4108b905

4
app.py
View File

@@ -77,8 +77,10 @@ class AppLauncher:
def check_npm_installed(self): def check_npm_installed(self):
"""Check if npm is installed""" """Check if npm is installed"""
try: try:
# Use npm.cmd on Windows, npm on Unix
npm_cmd = 'npm.cmd' if self.is_windows else 'npm'
result = subprocess.run( result = subprocess.run(
['npm', '--version'], [npm_cmd, '--version'],
capture_output=True, capture_output=True,
text=True, text=True,
check=True check=True