aleph-vm
aleph-vm copied to clipboard
The Typescript SDK is not compatible with the runtime Nodejs 12
Describe the bug
The Typescript SDK is incompatible with the current runtime since only Nodejs 12 is provided - and the SDK requires a more recent version.
We should install a recent version of Nodejs when creating the runtime rootfs instead of using the version provided by Debian 11 Bullseye.
Installing it from Nodesource looks like a recommended approach: https://github.com/nodesource/distributions/blob/master/README.md
This may be enough:
diff --git a/runtimes/aleph-debian-11-python/create_disk_image.sh b/runtimes/aleph-debian-11-python/create_disk_image.sh
index 7fbb620..c6a10e8 100755
--- a/runtimes/aleph-debian-11-python/create_disk_image.sh
+++ b/runtimes/aleph-debian-11-python/create_disk_image.sh
@@ -22,7 +22,6 @@ apt-get install -y --no-install-recommends --no-install-suggests \
python3-setuptools \
python3-pip python3-cytoolz python3-pydantic \
iproute2 unzip \
- nodejs npm \
build-essential python3-dev
pip3 install 'fastapi~=0.71.0'
@@ -33,6 +32,10 @@ pip3 install 'aleph-client>=0.4.6' 'coincurve==15.0.0'
# Compile all Python bytecode
python3 -m compileall -f /usr/local/lib/python3.9
+# Install Nodejs 18
+curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
+apt-get install -y nodejs
+
echo "root:toor" | /usr/sbin/chpasswd
mkdir -p /overlay