Skip to content

Instantly share code, notes, and snippets.

@devmatteini
Created October 23, 2021 15:39
Show Gist options
  • Save devmatteini/88319045d1cf981d464190df3c06e3f3 to your computer and use it in GitHub Desktop.
Save devmatteini/88319045d1cf981d464190df3c06e3f3 to your computer and use it in GitHub Desktop.
Install node on Raspberry Pi Zero
#!/bin/bash
if [ -z "$1" ];then
echo "Usage: $(basename "${BASH_SOURCE[0]}") <version>"
exit 1
fi
version=$1
archive="node-${version}-download"
folder="node-${version}"
echo "Download node tar archive..."
curl -s "https://unofficial-builds.nodejs.org/download/release/v${version}/node-v${version}-linux-armv6l.tar.gz" -o "$archive"
echo "Extracting node archive..."
tar xf "$archive"
mv "node-v${version}-linux-armv6l" "$folder"
eval "./${folder}/bin/node --version"
rm "$archive"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment