@@ -23,10 +23,21 @@ main() {
23
23
# Grabs the major version of node from $npm_config_user_agent which looks like
24
24
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
25
25
major_node_version=$( echo " $npm_config_user_agent " | sed -n ' s/.*node\/v\([^.]*\).*/\1/p' )
26
- if [ " $major_node_version " -lt 14 ]; then
27
- echo " code-server currently requires at least node v14"
26
+
27
+ if [ -n " $FORCE_NODE_VERSION " ]; then
28
+ echo " WARNING: Overriding required Node.js version to v$FORCE_NODE_VERSION "
29
+ echo " This could lead to broken functionality, and is unsupported."
30
+ echo " USE AT YOUR OWN RISK!"
31
+ fi
32
+
33
+ if [ " $major_node_version " -ne ${FORCE_NODE_VERSION:- 14} ]; then
34
+ echo " ERROR: code-server currently requires node v14."
35
+ if [ -n " $FORCE_NODE_VERSION " ]; then
36
+ echo " However, you have overrided the version check to use v$FORCE_NODE_VERSION ."
37
+ fi
28
38
echo " We have detected that you are on node v$major_node_version "
29
- echo " See https://github.com/cdr/code-server/issues/1633"
39
+ echo " You can override this version check by setting \$ FORCE_NODE_VERSION,"
40
+ echo " but configurations that do not use the same node version are unsupported."
30
41
exit 1
31
42
fi
32
43
@@ -54,6 +65,12 @@ main() {
54
65
echo " Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"
55
66
exit 1
56
67
fi
68
+
69
+ if [ -n " $FORCE_NODE_VERSION " ]; then
70
+ echo " WARNING: The required Node.js version was overriden to v$FORCE_NODE_VERSION "
71
+ echo " This could lead to broken functionality, and is unsupported."
72
+ echo " USE AT YOUR OWN RISK!"
73
+ fi
57
74
}
58
75
59
76
# This is a copy of symlink_asar in ../lib.sh. Look there for details.
0 commit comments