Increased minimum required version of Node.js

This commit is contained in:
Nikita Khromov
2023-08-22 15:38:48 +08:00
committed by Sergey Konovalov
parent d8b759841e
commit 48ecc3915e

View File

@ -168,21 +168,21 @@ def check_nodejs():
nodejs_cur_version_major = int(nodejs_version.split('.')[0][1:])
nodejs_cur_version_minor = int(nodejs_version.split('.')[1])
print('Installed Node.js version: ' + nodejs_version[1:])
nodejs_min_version = '14.14'
nodejs_min_version = '18'
nodejs_min_version_minor = 0
major_minor_min_version = nodejs_min_version.split('.')
nodejs_min_version_major = int(major_minor_min_version[0])
if len(major_minor_min_version) > 1:
nodejs_min_version_minor = int(major_minor_min_version[1])
nodejs_max_version = '18'
nodejs_max_version = ""
nodejs_max_version_minor = float("inf")
major_minor_max_version = nodejs_max_version.split('.')
nodejs_max_version_major = int(major_minor_max_version[0])
# nodejs_max_version_major = int(major_minor_max_version[0])
nodejs_max_version_major = float("inf")
if len(major_minor_max_version) > 1:
nodejs_max_version_minor = int(major_minor_max_version[1])
if (nodejs_min_version_major > nodejs_cur_version_major or nodejs_cur_version_major > nodejs_max_version_major):
print('Installed Node.js version must be 14.14 to 18.x')
isNeedReinstall = True
elif (nodejs_min_version_major == nodejs_cur_version_major):
if (nodejs_min_version_minor > nodejs_cur_version_minor):
@ -192,7 +192,7 @@ def check_nodejs():
isNeedReinstall = True
if (True == isNeedReinstall):
print('Installed Node.js version must be 14.14 to 14.x')
print('Installed Node.js version must be 18 or higher.')
if (host_platform == 'windows'):
dependence.append_uninstall('Node.js')
dependence.append_install('Node.js')
@ -906,7 +906,7 @@ def install_postgresql():
return code
def install_nodejs():
os.system('curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -')
os.system('curl -sSL https://deb.nodesource.com/setup_18.x | sudo -E bash -')
base.print_info("Install node.js...")
install_command = 'yes | sudo apt install nodejs'
print(install_command)
@ -915,7 +915,7 @@ def install_nodejs():
downloads_list = {
'Windows': {
'Git': 'https://github.com/git-for-windows/git/releases/download/v2.29.0.windows.1/Git-2.29.0-64-bit.exe',
'Node.js': 'https://nodejs.org/download/release/v14.17.6/node-v14.17.6-x64.msi',
'Node.js': 'https://nodejs.org/dist/v18.17.1/node-v18.17.1-x64.msi',
'Java': 'https://aka.ms/download-jdk/microsoft-jdk-11.0.18-windows-x64.msi',
'RabbitMQ': 'https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.9/rabbitmq-server-3.8.9.exe',
'Erlang': 'http://erlang.org/download/otp_win64_23.1.exe',