From 194181a42052ca1045a7ec24ef4f110d59037ce2 Mon Sep 17 00:00:00 2001 From: Ketan Ramaneti Date: Sun, 29 Dec 2024 13:55:24 +0300 Subject: [PATCH] check node.js req for 20.x or later (#5877) --- Development.md | 2 +- Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Development.md b/Development.md index 1eaa3054773b..fbdaac497e91 100644 --- a/Development.md +++ b/Development.md @@ -8,7 +8,7 @@ Otherwise, you can clone the OpenHands project directly. * Linux, Mac OS, or [WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/install) [Ubuntu <= 22.04] * [Docker](https://docs.docker.com/engine/install/) (For those on MacOS, make sure to allow the default Docker socket to be used from advanced settings!) * [Python](https://www.python.org/downloads/) = 3.12 -* [NodeJS](https://nodejs.org/en/download/package-manager) >= 18.17.1 +* [NodeJS](https://nodejs.org/en/download/package-manager) >= 20.x * [Poetry](https://python-poetry.org/docs/#installing-with-the-official-installer) >= 1.8 * OS-specific dependencies: - Ubuntu: build-essential => `sudo apt-get install build-essential` diff --git a/Makefile b/Makefile index c4e1949b9621..e1f14c410f43 100644 --- a/Makefile +++ b/Makefile @@ -81,10 +81,10 @@ check-nodejs: @if command -v node > /dev/null; then \ NODE_VERSION=$(shell node --version | sed -E 's/v//g'); \ IFS='.' read -r -a NODE_VERSION_ARRAY <<< "$$NODE_VERSION"; \ - if [ "$${NODE_VERSION_ARRAY[0]}" -gt 18 ] || ([ "$${NODE_VERSION_ARRAY[0]}" -eq 18 ] && [ "$${NODE_VERSION_ARRAY[1]}" -gt 17 ]) || ([ "$${NODE_VERSION_ARRAY[0]}" -eq 18 ] && [ "$${NODE_VERSION_ARRAY[1]}" -eq 17 ] && [ "$${NODE_VERSION_ARRAY[2]}" -ge 1 ]); then \ + if [ "$${NODE_VERSION_ARRAY[0]}" -ge 20 ]; then \ echo "$(BLUE)Node.js $$NODE_VERSION is already installed.$(RESET)"; \ else \ - echo "$(RED)Node.js 18.17.1 or later is required. Please install Node.js 18.17.1 or later to continue.$(RESET)"; \ + echo "$(RED)Node.js 20.x or later is required. Please install Node.js 20.x or later to continue.$(RESET)"; \ exit 1; \ fi; \ else \