From 40c140bbbf754d033ee35a9403c2c5b1e1934d5f Mon Sep 17 00:00:00 2001 From: Haitao Pan Date: Wed, 28 Jan 2026 11:01:22 +0800 Subject: [PATCH] scripts: fix nodesource install --- scripts/init_vhost.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/init_vhost.sh b/scripts/init_vhost.sh index a8da4e10a..e6e5109fd 100755 --- a/scripts/init_vhost.sh +++ b/scripts/init_vhost.sh @@ -97,7 +97,11 @@ ensure_node24() { if [[ "$need_install" -eq 1 ]]; then as_root apt-get update as_root apt-get install -y curl ca-certificates - curl -fsSL https://deb.nodesource.com/setup_24.x | as_root -E bash - + if [[ $(id -u) -eq 0 ]]; then + curl -fsSL https://deb.nodesource.com/setup_24.x | bash - + else + curl -fsSL https://deb.nodesource.com/setup_24.x | as_root -E bash - + fi as_root apt-get install -y nodejs fi }