Skip to content

Commit a35141a

Browse files
committed
fix: make js-build graceful when npm is not available
Guard the js-build target so it warns instead of failing when npm is not installed. This prevents serve/dev targets from breaking in environments without Node.js — the API server still starts, only the admin UI bundle is skipped. Also adds --no-audit --no-fund to suppress noisy npm output during server startup. Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
1 parent 93b8fd9 commit a35141a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,11 @@ check-env-dev:
260260

261261
## --- JS build ----------------------------------------------------------------
262262
js-build: ## Install npm dependencies and build JS bundle with Vite
263-
npm install
264-
npm run vite:build
263+
@if command -v npm >/dev/null 2>&1; then \
264+
npm install --no-audit --no-fund && npm run vite:build; \
265+
else \
266+
echo "WARNING: npm not found — skipping JS bundle build (admin UI may not load)"; \
267+
fi
265268

266269
## --- Primary servers ---------------------------------------------------------
267270
serve: js-build ## Run production server with Gunicorn + Uvicorn (default)

0 commit comments

Comments
 (0)