diff --git a/deploy b/deploy
index b38dea2c309a7990be031c5d3280afe6b8662d7c..8a21f69ac168e351a514217d10679a7ac30af50f 100755
--- a/deploy
+++ b/deploy
@@ -12,11 +12,11 @@ git stash
 git pull
 
 ## Composer
-php8.1 /usr/bin/composer install --prefer-dist --no-interaction --optimize-autoloader
+php8.1 $(which composer) install --prefer-dist --no-interaction --optimize-autoloader || exit 1
 
 ## CSS & JS
-npm install
-npm run production
+npm install || exit 1
+npm run production || exit 1
 
 # Get correct version info from git tag and replace into template
 VERSION=$(git describe --tags)