Skip to content

Commit c51a5af

Browse files
committed
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.
1 parent 2b2f8b3 commit c51a5af

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎ci/build/npm-postinstall.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ main() {
6767

6868
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-24}" ]; then
6969
echo "ERROR: code-server currently requires node v24."
70-
if [ -n "$FORCE_NODE_VERSION" ]; then
70+
if [ -n "${FORCE_NODE_VERSION:-}" ]; then
7171
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
7272
fi
7373
echo "We have detected that you are on node v$major_node_version"

0 commit comments

Comments
 (0)