Fix npm installation issues during setup
- Created reusable ensure_npm_packages function for consistency - Fixed npm install being called in wrong directory during installation - Added proper directory context preservation for npm operations - Ensured package.json file is always copied to installation directory - Added checks to prevent redundant npm installations - Improved error handling and reporting for npm operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -295,10 +295,8 @@ EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Install npm dependencies
|
||||
log "INFO" "Updating npm dependencies..."
|
||||
cd "$SCRIPT_DIR"
|
||||
npm install || {
|
||||
# Install npm dependencies using our common function
|
||||
ensure_npm_packages "$INSTALL_DIR" || {
|
||||
log "ERROR" "NPM installation failed"
|
||||
exit 1
|
||||
}
|
||||
@@ -393,10 +391,8 @@ else
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Step 6: Install npm dependencies
|
||||
log "INFO" "Installing npm dependencies..."
|
||||
cd "$SCRIPT_DIR"
|
||||
npm install || {
|
||||
# Step 6: Install npm dependencies using our common function
|
||||
ensure_npm_packages "$INSTALL_DIR" || {
|
||||
log "ERROR" "NPM installation failed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user