fix: improve npm dependency installation in installer

- 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 <noreply@anthropic.com>
This commit is contained in:
courtmanr@gmail.com
2025-05-31 14:46:39 +01:00
parent 14249b9718
commit bf7d85a2e3
+10 -3
View File
@@ -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