From 07a4adb96118677635a37a352fac9f67370481c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Koh=C3=A1nyi=20R=C3=B3bert?= Date: Fri, 20 Mar 2026 07:10:15 +0000 Subject: [PATCH] fix: source nvm in playwright install script so npx is on PATH --- src/playwright/install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/playwright/install.sh b/src/playwright/install.sh index b335aac..53bd4f8 100644 --- a/src/playwright/install.sh +++ b/src/playwright/install.sh @@ -2,11 +2,16 @@ set -e +# Source nvm so npx is available during feature installation +# (containerEnv PATH additions from the node feature don't apply to install scripts) +export NVM_DIR="${NVM_DIR:-/usr/local/share/nvm}" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + # Install Playwright browsers # If _REMOTE_USER is set and not root, install as that user # Otherwise install as root (test scenarios) if [ -n "${_REMOTE_USER}" ] && [ "${_REMOTE_USER}" != "root" ] && id -u "${_REMOTE_USER}" > /dev/null 2>&1; then - su "${_REMOTE_USER}" -c "npx playwright install --with-deps ${BROWSERS}" + su "${_REMOTE_USER}" -c "export NVM_DIR=\"${NVM_DIR}\"; [ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\"; npx playwright install --with-deps ${BROWSERS}" else npx playwright install --with-deps ${BROWSERS} fi