Skip to content

Instantly share code, notes, and snippets.

@jimbuck
Created May 25, 2018 21:06
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 jimbuck/70248464d37eb3f7ea5afb3fae7406e1 to your computer and use it in GitHub Desktop.
Save jimbuck/70248464d37eb3f7ea5afb3fae7406e1 to your computer and use it in GitHub Desktop.
PI Zero NodeJS
#!/bin/bash
version=$1
if [ -z "$version" ]; then
echo Must provide a version!
exit;
fi
filename=node-v$version-linux-armv6l
echo Installing NodeJS v$1...
echo " Downloading..."
curl -o ./downloads/$filename.tar.gz https://nodejs.org/dist/latest/$filename.tar.gz
echo " Extracting..."
tar -xzf ./downloads/$filename.tar.gz -C ./temp
echo " Installing..."
cp -r ./temp/$filename/* /usr/local/
node -v
npm -v
echo " Complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment