diff --git a/scripts/deploy.mjs b/scripts/deploy.mjs index 3723d33..9cdc51f 100644 --- a/scripts/deploy.mjs +++ b/scripts/deploy.mjs @@ -122,6 +122,12 @@ function main() { const sudoLines = SUDO_PASS ? `${SUDO_PASS}\n${SUDO_PASS}\n` : undefined; const script = [ `cd ${REMOTE_PATH} || exit 3`, + // node_modules is excluded from the rsync, so a new dependency in the + // lockfile would otherwise fail the build on a server that has never + // installed it. Installed as the login user: the checkout belongs to them. + 'npm ci --no-audit --no-fund', + 'deps=$?', + '[ "$deps" -eq 0 ] || { echo "deploy: remote npm ci failed ($deps)"; exit "$deps"; }', `${sudo}npm run build`, 'build=$?', '[ "$build" -eq 0 ] || { echo "deploy: remote build failed ($build)"; exit "$build"; }',