Skip to content

Commit 3aae3b7

Browse files
Update update.sh
1 parent 35b2477 commit 3aae3b7

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

update.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ install_and_build() {
617617
log_error "package.json not found! Cannot install dependencies."
618618
return 1
619619
fi
620-
620+
log "Current working directory: $(pwd)"
621621
# Check if package-lock.json exists (it should from the new release)
622622
if [ -f "package-lock.json" ]; then
623623
log "Using package-lock.json from new release"
@@ -640,11 +640,22 @@ install_and_build() {
640640
# Create temporary file for npm output
641641
local npm_log="/tmp/npm_install_$$.log"
642642

643-
# Run npm install (using the new package.json and package-lock.json from release)
644-
log "Running npm install (this may take a few minutes)..."
645-
npm install > "$npm_log" 2>&1
643+
# Ensure NODE_ENV is not set to production during install (we need devDependencies for build)
644+
local old_node_env="${NODE_ENV:-}"
645+
export NODE_ENV=development
646+
647+
# Run npm install to get ALL dependencies including devDependencies
648+
log "Running npm install --include=dev (this may take a few minutes)..."
649+
npm install --include=dev > "$npm_log" 2>&1
646650
local npm_exit_code=$?
647651

652+
# Restore NODE_ENV
653+
if [ -n "$old_node_env" ]; then
654+
export NODE_ENV="$old_node_env"
655+
else
656+
unset NODE_ENV
657+
fi
658+
648659
# Always show npm output (last 30 lines)
649660
log "npm install output (last 30 lines):"
650661
tail -30 "$npm_log" | while read -r line; do

0 commit comments

Comments
 (0)