From f3af489ec2f73eda1337ccb54214a21a43957874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Ayd=C4=B1n?= Date: Sun, 7 Jun 2026 20:55:58 +0300 Subject: [PATCH] install.sh: hint at root-owned npm cache when desktop npm install fails (#39688) When apps/desktop's `npm ci`/`npm install` fails, install_desktop printed a single "Desktop workspace npm install failed" line and aborted, leaving the user with a wall of raw npm output. A common trigger is a root-owned ~/.npm cache left by an earlier `sudo npm`/`sudo npx`: the non-root install then cannot write the shared cache, and npm reports it as EEXIST / "File exists" while the real errno is EACCES (-13) -- so it reads like an installer bug. Add a targeted remediation hint on that failure path pointing at: sudo chown -R "$(id -un)" ~/.npm && npm cache verify followed by the manual rebuild command. The stage stays a hard failure by design (a silent skip yields a "complete" install with no app); only the failure output changes. --- scripts/install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index d735c6d75b..e24e6537b6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2307,6 +2307,16 @@ install_desktop() { log_info "Installing desktop workspace dependencies (includes Electron ~150MB, 1-3min)..." ( cd "$INSTALL_DIR" && npm ci ) || ( cd "$INSTALL_DIR" && npm install ) || { log_error "Desktop workspace npm install failed" + # Common cause: a previous 'sudo npm'/'sudo npx' left root-owned files in + # ~/.npm, so this non-root install can't write the shared cache. npm hides + # it behind a confusing EEXIST / "File exists" message while the real errno + # is EACCES (-13). Point the user at the fix instead of a raw npm trace. + log_info "If the errors above mention EACCES / 'permission denied' / EEXIST while" + log_info "writing the npm cache, your ~/.npm likely holds root-owned files from an" + log_info "earlier 'sudo npm' or 'sudo npx'. Reclaim ownership and retry:" + log_info " sudo chown -R \"\$(id -un)\" ~/.npm && npm cache verify" + log_info "Then re-run this installer, or build manually:" + log_info " cd \"$INSTALL_DIR\" && npm ci && cd apps/desktop && npm run pack" return 1 } log_success "Desktop workspace dependencies installed"