# some OSes require a newer version of NodeJS
# NOTE: Using the LTS binaries for NodeJS
export NODEJS_VERSION=v14.18.1
-export NODEJS_BINDIR=node-$(NODEJS_VERSION)-linux-x64
+MACHINE_NAME = $(shell uname -m)
+ifeq ($(MACHINE_NAME),x86_64)
+ export NODEJS_ARCHITECTURE=x64
+else ifeq ($(MACHINE_NAME),aarch64)
+ export NODEJS_ARCHITECTURE=arm64
+else
+ export NODEJS_ARCHITECTURE=$(MACHINE_NAME)
+endif
+export NODEJS_BINDIR=node-$(NODEJS_VERSION)-linux-$(NODEJS_ARCHITECTURE)
export NODEJS_TARBIN=$(NODEJS_BINDIR).tar.xz
export NODEJS_BINARY="https://nodejs.org/dist/$(NODEJS_VERSION)/$(NODEJS_TARBIN)"