From bf7d85a2e393cdc6dee65a47b23e73ec944841c1 Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Sat, 31 May 2025 14:46:39 +0100 Subject: [PATCH] fix: improve npm dependency installation in installer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Switch from npm install to npm ci for clean installs based on package-lock.json - Add fallback to npm install if npm ci fails - Remove --unsafe-perm flag and use --omit=dev for production installs - Show dependency installation output (filtering npm WARN messages) This ensures that package-lock.json changes are properly applied during updates, fixing issues where old dependencies remain after updates. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- scripts/install-pulse.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/install-pulse.sh b/scripts/install-pulse.sh index fbfa4cf0a..fcc0deeeb 100755 --- a/scripts/install-pulse.sh +++ b/scripts/install-pulse.sh @@ -2204,9 +2204,16 @@ case "$INSTALL_MODE" in if [ "$TARBALL_INSTALL_SUCCESS" != "true" ]; then print_info "Installing NPM dependencies in $PULSE_DIR..." cd "$PULSE_DIR" || { print_error "Failed to cd to $PULSE_DIR before npm install"; exit 1; } - if ! npm install --unsafe-perm --silent; then - print_error "Failed to install NPM dependencies. See output above." - exit 1 + + # Use npm ci for clean install based on package-lock.json + print_info "Performing clean install of dependencies..." + if ! npm ci --omit=dev 2>&1 | grep -v "^npm WARN"; then + print_error "Failed to install NPM dependencies." + print_error "Falling back to npm install..." + if ! npm install --omit=dev 2>&1 | grep -v "^npm WARN"; then + print_error "Failed to install NPM dependencies. See output above." + exit 1 + fi else print_success "NPM dependencies installed." fi