AOSSIE-Org / AOSSIE-Org/PictoPy

npm run win-dev hangs on Windows due to missing backend and sync run.bat scripts

未關閉
#1,063 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
283
分支
679
平均合併
7 天 2 小時
30 天內合併 PR
3

描述

**What Happened**
On Windows systems, running npm run win-dev starts the command but fails to launch the backend services. This causes the terminal to hang at “Waiting for servers to start” or fail without starting the required Python processes.

**Problem**
- The issue stemmed from missing platform-specific startup scripts in the source code repository.
The entry point, `scripts/win-dev.bat`, contains commands to specifically execute `run.bat` within the `backend/` and `sync-microservice/` directories.
- Root Cause: These `run.bat` files were not present in the repository. While `run.sh` files existed for Linux/macOS users, the Windows equivalents were omitted.
- Result:
When win-dev.bat executed `start "" /B run.bat`, the command failed to locate the target file, resulting in the backend services never starting.

**Expected Behavior**

When a developer runs `npm run win-dev` on a Windows machine:
The script should locate and execute `backend/run.bat` to start the main Python backend.
The script should locate and execute `sync-microservice/run.bat` to start the synchronization service.
Both services should run in the background.
The frontend should launch and successfully connect to these running local services.

**Suggestions for Prevention & Improvement**
Immediately Actionable

Commit Missing Files:
Ensure both `backend/run.bat` and `sync-microservice/run.bat` are permanently added to the git repository so they are available for all future Windows users.

Long-Term Improvements

Robust Scripting:
Add explicit if exist checks in scripts/win-dev.bat. If run.bat is missing, the script should exit immediately with a helpful error message (e.g., Error: backend/run.bat not found) instead of failing silently.

Cross-Platform Task Running:
Consider replacing OS-specific shell scripts (.bat and .sh) with a platform-agnostic task runner (e.g., concurrently, nx, or a Node.js script).

CI/CD Verification:
Add a CI step to verify that all scripts referenced in package.json exist in the file system.

**Record**
- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。