Skip to content

Instantly share code, notes, and snippets.

@nopivnick
Created October 27, 2021 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nopivnick/c26a72c7e02253906d86a0457bd57d15 to your computer and use it in GitHub Desktop.
Save nopivnick/c26a72c7e02253906d86a0457bd57d15 to your computer and use it in GitHub Desktop.
export NODE_VER=12.22.7
if ! node --version | grep -q ${NODE_VER}; then
(cat /proc/cpuinfo | grep -q "Pi Zero") && if [ ! -d node-v${NODE_VER}-linux-armv6l ]; then
echo "Installing nodejs ${NODE_VER} for armv6 from unofficial builds..."
curl -O https://unofficial-builds.nodejs.org/download/release/v${NODE_VER}/node-v${NODE_VER}-linux-armv6l.tar.xz
tar -xf node-v${NODE_VER}-linux-armv6l.tar.xz
fi
echo "Adding node to the PATH"
PATH=$(pwd)/node-v${NODE_VER}-linux-armv6l/bin:${PATH}
fi
node --version # or whatever ....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment