nodejs Application Development on Device

Script Installation
# current
VERSION=v23.3.0
# lts
#VERSION=v22.12.1
DISTRO=linux-armv7l
opkg update
opkg install xz
opkg install libatomic1
ARCH=$(uname -i)
if [[ "$ARCH" = *aarch64* ]]; then
DISTRO=linux-arm64
echo "arm64"
fi;
if [[ "$ARCH" = *x86_64* ]]; then
DISTRO=linux-x64
echo "x86_64";
fi;
cd /tmp
mkdir -p /usr/local/
wget https://nodejs.org/dist/$VERSION/node-$VERSION-$DISTRO.tar.xz
tar -xvf node-$VERSION-$DISTRO.tar.xz
cd node-$VERSION-$DISTRO
cp -R * /usr/
cd /tmp
rm -rf node-$VERSION-$DISTRO
rm node-$VERSION-$DISTRO.tar.xz
sync
Manualy Installation
First Download the Linux Binaries (ARMv7 or 64-bit) @ https://nodejs.org/en/download/
if Command "uname -i":
aarch64: node-[version]-linux-arm64.tar.xz
x86_64: node-[version]-linux-x64.tar.xz
else: node-[version]-linux-armv7l.tar.xz
Next Upload the Binaries to the device via SSH or FileManager in the WebConfig
Open a Terminal
First install neccesarry packages
opkg update
opkg install xz
opkg install libatomic1
Now use tar
to unpack the file
tar -xvf node-[version]-linux-armv7l.tar.xz
Install NodeJS into/usr/
cd node-[version]-linux-armv7l
cp -R * /usr/
Clean up the temporary files.
cd ~
rm -rf node-[version]-linux-armv7l
rm node-[version]-linux-armv7l.tar.xz
Test
You can check that NodeJS and NPM are installed correctly by confirming their version numbers from Terminal by running
node -v
npm -v