@@ -23,10 +23,21 @@ main() {
2323 # Grabs the major version of node from $npm_config_user_agent which looks like
2424 # yarn/1.21.1 npm/? node/v14.2.0 darwin x64
2525 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
2838 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."
3041 exit 1
3142 fi
3243
@@ -54,6 +65,12 @@ main() {
5465 echo " Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"
5566 exit 1
5667 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
5774}
5875
5976# This is a copy of symlink_asar in ../lib.sh. Look there for details.
0 commit comments