Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: add npm scripts for pm2 to avoid command not found after setup
Adam Eivy2900517104c7
diff --git a/.changelog/v0.10.x.md b/.changelog/v0.10.x.mdindex 36d33211f5..12dd9a9c06 100644--- a/.changelog/v0.10.x.md+++ b/.changelog/v0.10.x.md@@ -266,6 +266,11 @@ This release introduces a structured changelog documentation system for creating- **Metadata Tracking**: Run metadata now includes `hadReasoning` and `usedReasoningAsFallback` flags for debugging- **Impact**: Task enhancement and other AI services now work correctly with reasoning-based local models+### Setup Script pm2 Command Not Found+- **Fixed post-setup pm2 availability**: After running `./setup.sh`, users would get "zsh: command not found: pm2" because pm2 is installed locally in `server/node_modules`, not globally+- **Added npm scripts**: New `npm run pm2:start`, `npm run pm2:stop`, and `npm run pm2:logs` scripts that use `npx` to run the local pm2+- **Updated documentation**: Setup script output and CLAUDE.md now reference the npm scripts instead of direct pm2 commands+### Critical: Fixed "Unexpected end of JSON input" Errors- **Safe JSON Parsing**: Added comprehensive JSON parsing utilities to `server/lib/fileUtils.js`:- `isValidJSON(str)` - Pre-validates JSON structure before parsing (supports both objects and arrays)@@ -286,7 +291,7 @@ This release introduces a structured changelog documentation system for creatinggit clone https://github.com/atomantic/PortOS.gitcd PortOSnpm run install:all-pm2 start ecosystem.config.cjs+npm run pm2:start```## 🔗 Full Changelogdiff --git a/CLAUDE.md b/CLAUDE.mdindex 791189001e..439cecaab2 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -16,8 +16,9 @@ cd server && npm testcd server && npm run test:watch # Watch mode# Production-pm2 start ecosystem.config.cjs-pm2 logs+npm run pm2:start+npm run pm2:stop+npm run pm2:logs```## Architecturediff --git a/package.json b/package.jsonindex dd162bbe5d..903c686c0c 100644--- a/package.json+++ b/package.json@@ -17,6 +17,9 @@"dev:client": "cd client && npm run dev","build": "cd client && npm run build","start": "cd server && npm start",+ "pm2:start": "npx pm2 start ecosystem.config.cjs",+ "pm2:stop": "npx pm2 stop ecosystem.config.cjs",+ "pm2:logs": "npx pm2 logs","install:all": "npm install && cd client && npm install && cd ../server && npm install && cd .. && npm run setup","setup": "node scripts/setup-data.js && node scripts/setup-browser.js","setup:data": "node scripts/setup-data.js",diff --git a/setup.sh b/setup.shindex 38f2a98f8c..ccff0c1517 100755--- a/setup.sh+++ b/setup.sh@@ -35,7 +35,9 @@ echo "==================================="echo ""echo "Start PortOS:"echo " Development: npm run dev"-echo " Production: pm2 start ecosystem.config.cjs"+echo " Production: npm run pm2:start"+echo " Stop: npm run pm2:stop"+echo " Logs: npm run pm2:logs"echo ""echo "Access at: http://localhost:5555"echo ""