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"