From c51a5af88a5e100a82a5f911fd32d95ed0063ecd Mon Sep 17 00:00:00 2001 From: Den Kong Date: Fri, 4 Sep 2026 12:44:26 +0800 Subject: [PATCH] fix: guard FORCE_NODE_VERSION in the version error path Installing on the wrong node version dies with "FORCE_NODE_VERSION: unbound variable" instead of explaining itself. The script runs under set -u and this is the one place the variable is read bare; the three other reads all default it. The lines it never reaches are the ones telling you the override exists and naming it, so the people who most need that message are the only ones who cannot see it. Verified on Windows 11 with node 22 and code-server 4.135.0: before, the install ends at the unbound variable; after, it prints the version error and the override instructions, and exits as intended. --- ci/build/npm-postinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 3c2bcb2dbff0..29e46b388220 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -67,7 +67,7 @@ main() { if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-24}" ]; then echo "ERROR: code-server currently requires node v24." - if [ -n "$FORCE_NODE_VERSION" ]; then + if [ -n "${FORCE_NODE_VERSION:-}" ]; then echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION." fi echo "We have detected that you are on node v$major_node_version"