From 1a90ab4dd3ad89f0fcf4990774be80201e8c04e7 Mon Sep 17 00:00:00 2001 From: Anton Dziatkovskii <194927794+tonydzi@users.noreply.github.com> Date: Mon, 21 Sep 2026 08:19:51 +0100 Subject: [PATCH] fix(dashboard): install node dependencies before building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The README's from-source path is `git clone` → `pip install -e .` → `./build-dashboard.sh`, but the script goes straight to `npm run build`. A fresh clone has no node_modules, so the build stops at > vite build 'vite' is not recognized as an internal or external command and the server keeps serving the "dashboard not built" page. Running `npm ci` by hand first is what actually makes it work, so the script now does that itself when node_modules has no vite binary (`npm install` when there is no lockfile). Verified on a clean tree: with node_modules moved aside the old script fails as above; the patched script installs and finishes with "Built: index-*.js index-*.css", and the running server picks the build up. Assisted-by: Claude Code / claude-opus-5 Machine: A-2022BAYAREA Account: tonydzi Operator: anton Co-Authored-By: Claude Opus 5 --- build-dashboard.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build-dashboard.sh b/build-dashboard.sh index 4c79e03..ac480f7 100755 --- a/build-dashboard.sh +++ b/build-dashboard.sh @@ -6,6 +6,17 @@ set -e # re-evaluated from inside dashboard/. ROOT="$(cd "$(dirname "$0")" && pwd)" cd "$ROOT/dashboard" + +# A fresh clone has no node_modules, so `npm run build` dies with +# "vite: not recognized" before anything is built. Install first. +if [ ! -x node_modules/.bin/vite ]; then + if [ -f package-lock.json ]; then + npm ci + else + npm install + fi +fi + npm run build ASSETS="$ROOT/the_lab/static/assets"